each(_POST)
Posted: Sat Sep 07, 2002 11:03 pm
Perhaps someone has already come up with a solution for this, however, I've written a very nice function that goes through any form and checks all required fields. However, if I use input type="Radio" or input type="Checkbox", the each() does not pick up on these form fields. Is there a better way way of doing this?
I've tried the following two ways:
while(list($key, $val) = each($_POST)) {
array_push($formKeys, $key);
array_push($formVals, $val);
}
or:
$formKeys = array_keys($_POST);
$formVals = array_values($_POST);
both ways ignore the radio and checkbox fields, what am I missing? I haven't tried to use multiple select boxes, though selects work just fine.
I've tried the following two ways:
while(list($key, $val) = each($_POST)) {
array_push($formKeys, $key);
array_push($formVals, $val);
}
or:
$formKeys = array_keys($_POST);
$formVals = array_values($_POST);
both ways ignore the radio and checkbox fields, what am I missing? I haven't tried to use multiple select boxes, though selects work just fine.