I've tried posting this in the general forum but haven't had much luck, so since this seems to be a pretty basic question, although some of the code isn't really newbie, I thought I would try it here.
I have a form with three menu/lists, each has a "default" (I use quotes because I am not sure if that is the right term) that is set to "None" while the rest of the menu is created with a loop that pulls from my DB. When the page loads, each menu displays "None" as it should. If the user clicks the Submit button without changing any of the menus, the next page gets "" from the first menu and "None" from the second and third. I need the next page to receive "None" from all three menus. When the user selects items other than "None" from the list, the next page works fine and all three menus send the correct item.
Since everyone wants to see code, and I swear there are two or three people who just sift through the forums posting "Could I see some code?" and then never return to the thread, here's the code:
<form action="user_bar_complete.php" method="post">
<fieldset>
<div align="center">
<p>
<legend><strong>Bar Destination Selection </strong></legend>
</p>
<p align="center">
<strong>Warning! </strong>Selecting a new bar from a menu will
replace the current bar you have set.
</p>
<label for="first">First Bar: <? echo $first_user_bar; ?></label><br/>
<select name="first">
<option value="None">None</option>
<?php
while ($row_hometown_bars = mysql_fetch_assoc($hometown_bars)) {
?>
<option value="<?php echo $row_hometown_bars['bar_name']?>" ><?php echo $row_hometown_bars['bar_name']?></option>
<?php
}
?>
</select><br/>
<? mysql_data_seek($hometown_bars, 0); ?>
<label for="second">Second Bar: <? echo $second_user_bar; ?></label><br/>
<select name="second">
<option value="None">None</option>
<?php
while ($row_hometown_bars = mysql_fetch_assoc($hometown_bars)) {
?>
<option value="<?php echo $row_hometown_bars['bar_name']?>" ><?php echo $row_hometown_bars['bar_name']?></option>
<?php } ?>
</select><br/>
<? mysql_data_seek($hometown_bars, 0); ?>
<label for="third">Third Bar: <? echo $third_user_bar; ?></label><br/>
<select name="third">
<option value="None">None</option>
<?php
while ($row_hometown_bars = mysql_fetch_assoc($hometown_bars)) {
?>
<option value="<?php echo $row_hometown_bars['bar_name']?>" ><?php echo $row_hometown_bars['bar_name']?></option>
<?php } ?>
</select><br/>
<label for="submit"> </label>
<p>
<input id="submit" name="submit" type="submit" value="Submit">
</p>
<p>Bars listed above the menus are the bars you currently have set as
your destination</p>
<p>Note: You do not need to select 3 bars at this time, or ever, but you
have the option of doing so if you choose. There is also
no difference between the bars you select, so "First
Bar" is not the bar you like more than "Second Bar,"
it's just the first bar on the list.</p>
</div>
</fieldset>
</form>
Just disregard the text in there, it's meant for users of the page.