Forum Moderators: open
Post the code from the select list here. You've probably just got something wrong in the list itself.
A form processor processes the form objects by name and displays their selected value. So in a select list,
<select name="widgets" id="widgets">
<option value="">SELECT</option>
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
</select>
By default, the first item in the list will display unless you have tagged one of the options as selected:
<option value="some_value" selected>Some Value</option>
It's my guess something in the first value is messed up and putting selected into the value, like maybe
<option value=selected>SELECT</option>
Post your code and someone here will fix it for you. :-)
Here is the original code used:
<select id="month" size="1" multiple="multiple" name="month">
<option selected="selected">January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
And here is the amended code that is missed out altogether in the email response.
<select id="month" size="1" multiple="multiple" name="month">
<option value="">Select</option>
<option value="january">January</option>
<option value="february">February</option>
<option value="march">March</option>
<option value="april">April</option>
<option value="may">May</option>
<option value="june">June</option>
<option value="july">July</option>
<option value="august">August</option>
<option value="september">September</option>
<option value="october">October</option>
<option value="november">November</option>
<option value="december">December</option>
</select>
Would really appreciate any advice anyone could give me on this one!
Becky
<select id="month" size="1" multiple="multiple" name="month">
<option value="january" selected>January</option>
<option value="february">February</option>
<option value="march">March</option>
<option value="april">April</option>
<option value="may">May</option>
<option value="june">June</option>
<option value="july">July</option>
<option value="august">August</option>
<option value="september">September</option>
<option value="october">October</option>
<option value="november">November</option>
<option value="december">December</option>
</select>
This works if you want to default to January
[edited by: Rightz at 5:33 pm (utc) on Sep. 4, 2006]
[javascript.about.com...]
[edited by: encyclo at 6:21 pm (utc) on Sep. 4, 2006]
[edit reason] linked URL [/edit]
So each table reservation is sent back as 01 January 2006.
Based on this statement, I have to ask, why are you using select multiple? While someone may want to make multiple reservations, connecting specifics of various reservations (how many people, booth or table, event title such as birthday, etc.) may be more confusing than anything.
The simplest solution (IMO) if you want to allow multiple reservations on a page is to have several sections and label them reservation #1, 2, 3. Dispense with selected values altogether. Just put a blank value in the first option and it will be selected by default.
The truth is, a lot of people don't even know how to use select multiple and it opens the option for user error. If you don't MAKE them do it right, they are likely to miss it. By setting january as selected, they may just not be selecting the month.
By using a regular drop-down
<select name="res_1_month" id="res_1_month">
<option value="">select</option>
You can check using Javascript or your server-side language for a blank value. If it's blank, return an error "Select your reservation month."
but this has the effect of missing out the data altogether when the form data comes through to me on email.
That's because nothing is "selected" now. Did you select one of the options? Again, select-multiple is confusing to many. :-)
Try the non-multiple method, I think that's what you're lookng for.