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

  • Thread starter Thread starter johngilmer
  • Start date Start date
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.
 
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
 
Back
Top