Forum Moderators: coopster
I'm using this code for the other fields:
// CHECKS TO SEE IF THE $FIRSTNAME VARIABLE IS VALID
if (!ereg("^[A-Za-z]{1,}$",$firstname))
{
echo ("<center>You entered an invalid <font color=\"#FF0000\"><b>FirstName</b></font>.</center>\n");
echo ("<br /><br />");
$validated = false;
}
I'm not sure if it only requires a slight change to use for the drop menus or not?
Please help, thanks
The code will work fine checking the value of the dropdown, but it won't return it to it's previous position.
to do that i use this function
function sort_selectboxes($name,$value)
{
if ($_REQUEST[$name]==$value)
{
return ' selected';
}
else
{
return '';
}
}
$enqchecked[0]=sort_selectboxes('select1','apples');
$enqchecked[1]=sort_selectboxes('select1','oranges');
$text.='<select name="select1">
<option value="apples" '.$enqchecked[0].'>apples</option>
<option value="oranges" '.$enqchecked[1].'>oranges</option>
hope that helps
Hughie