|
Hey, ive been programming for a while now, but i was wondering what the best way to do this. I have a drop down menu of maybe 10 things, and i was wondering how to echo the selected option if the form doesnt go through (like if they didnt fill in a required field) heres what i have so far
<option value="BASKETBALL" <?php if ($_POST["sport"] == "BASKETBALL") echo "selected"; ?>>Basketball</option>
<option value="GOLF" <?php if ($_POST["sport"] == "GOLF") echo "selected"; ?>>Golf</option>
<option value="TENNIS" <?php if ($_POST["sport"] == "TENNIS") echo "selected"; ?>>Tennis</option>
|