Select list need to display value selected.

T

Toni

This may not be the correct place to post this question. I am doing some
HTML, but not with in Frontpage. I am unsure where to post this question,
please advise... This was the oNly place I could find with questions on HTML
code.

I created a select list using data from a table.
The problem I am having is after the user selects a value and the page is
redisplayed, the value selected is not the selected item in the list. The
list still dipslays the first item in the list.

For example the list has
Apples
Oranges
Pears

User selects Pears

When the Page is redisplayed the dropdown list dipslays Applse

Below is my html code to display the list.

"<td align=""left""><select name=""selVendorList" & intItemCount & """
Selected value=""" & rsShowPOLogDetail("ExhibitorName").value & """
size=""1"">" & strVendorList & "</select></td>" & _
Below is what I see when view source code, the selected value is set
correctly but the drop down list still displays Apples.

<select name="selVendorList1"
Selected value="Pears" size="1">
<option value="{C08C942B-165A-4750-9E9F-0752711875FD}">Apples</option>
<option value="{48354614-2FE5-4F35-9D70-31A8E849C258}">Oranges</option>
<option value="{C1E717F2-30F0-4555-8E8C-0687E009EAA4}">Pears</option>
 
R

Ronx

When the page is redisplayed you will have to change strVendorList to
indicate the selected item, so the result becomes:

<select name="selVendorList1" size="1">
<option value="{C08C942B-165A-4750-9E9F-0752711875FD}">Apples</option>
<option value="{48354614-2FE5-4F35-9D70-31A8E849C258}">Oranges</option>
<option value="{C1E717F2-30F0-4555-8E8C-0687E009EAA4}"
selected="selected">Pears</option>

"Selected value" in the select tag does nothing except perhaps confuse
browsers - attributes cannot contain spaces, and none of selected, value,
selected_value and selected-value are valid attributes for the select tag.
selected is valid for the option tag.
--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp

Reply only to group - emails will be deleted unread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top