Is there any way to have a dropdown list with non-unique values?

J

johngilmer

I have a dropdown list where the text that the user sees is unique, but
the values behind the options in the list are not unique. So the
text/value pairs in the list might be:

a - 1
b - 2
c - 2

When I select the third option ("c") and postback, the server thinks
that the user actually selected the second option ("b") because it is
the first option with a value of 2. Is there any way to make this work
where it uses the text ("c") to identify which option is selected
instead of the value?
Thanks in advance.
 
P

Patrice

No, see the "value behind the list" as a unique identifier. Server side this
is ONLY this value that you get and you are then unable to know wether the
user selected b or c...

Looks like the logic you want is :
a - 1
b or c - 2

The user will then select the "b or c" line and server side we'll get the
value 2...

If you really want to distinguish wether the user select b or c, you'll have
to have a distinct "behind the list value" for those two entries...


Patrice
 

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

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top