dropdown puzzler

J

Jim Corey

I'm thinking this problem is not specific to ASP.NET but anyway:

I have a dropdown that I populate when the page loads, and I have values
that are different from the
text that displays, so the resulting html looks like:

<option value="BUF">120 </option>
<option value="ALB">126 </option>
<option value="ALB">127 </option>
<option value="ROC">149 </option>

Now, if I've selected the item containing '127' in the dropdown, when the
page posts back,
the item '126' displays.
The pattern is that the first item with the value of the selected item
('ALB' in this case) displays on postback.
If I select '149', then that will display at postback, since it's the first
item with a 'ROC'
as a value.

Can anybody explain? A solution would be welcome as well.
 
J

Jon Booth

All that gets passed back on submit from a form like that is ALB. The Text
is not passed back by the browser. The only way is to make sure your options
are unique values.
 

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

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top