...

View Full Version : Help with validation of a drop down menu



ladieballer2004
08-27-2009, 10:21 PM
Is there a way to validate a word drop dowm menu.
I one that has the following options. SELECT- Freshman- Sophomore-Junior-Senior.

THe default one showing is SELECT and I want my form to tell the user if she forgot to make a selection here is my code

[code]
if($Class=='SELECT')
{echo'<b>You forgot to enter your Class &nbsp &nbsp Press the Back Button <br/>';$dataOK = FALSE;}

Phil Jackson
08-27-2009, 10:32 PM
<?php
if($Class=="SELECT")
{
echo "<b>You forgot to enter your Class &nbsp &nbsp Press the Back Button <br/>";
$dataOK = FALSE;
}
?>

<select name="Class">
<option>SELECT</option>
<option>sdfsds</option>
<option>sdfsds</option>
<option>sdfsds</option>
<option>sdfsds</option>
</select>


should be ok. You should google "header(location: );" as using php we dont need to tell people to press the back button, you can make em!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum