Forum Moderators: coopster
1st page: user enters info
2nd page: error checks, if incorrect: send back to page 1 and repopulate all form elements. I do not know how to repopulate the radio buttons.
You should be able to pass it as a variable...
page 1:
<input type="radio" name="optRadio" checked="<?=strChecked?>"> Last Name:
page 2:
if($optRadio == "lastName") {
nameValidate();
$strChecked = "checked";
}
This works but how would I set this up for multiple radio buttons. Or is there an easier way all together to do this?
thanks
...
if ($position=="top") $radio1["top"]=" checked";
else radio1["top"]="";
if ($position=="middle") $radio1["middle"]=" checked";
else radio1["middle"]="";
if ($position=="bottom") $radio1["bottom"]=" checked";
else radio1["bottom"]="";
...
<input type="radio" name="position" value="top" <? echo $radio1["top"];?>>Top<br>
<input type="radio" name="position" value="middle" <? echo $radio1["middle"];?>>Middle<br>
<input type="radio" name="position" value="bottom" <? echo $radio1["bottom"];?>>Bottom<br>
...