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

Discussion in 'ASP .Net' started by johngilmer@yahoo.com, May 12, 2005.

  1. Guest

    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.
     
    , May 12, 2005
    #1
    1. Advertising

  2. Patrice Guest

    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

    --

    <> a écrit dans le message de
    news:...
    > 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.
    >
     
    Patrice, May 12, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mufasa
    Replies:
    7
    Views:
    369
    Mufasa
    Jun 11, 2007
  2. ToshiBoy
    Replies:
    6
    Views:
    858
    ToshiBoy
    Aug 12, 2008
  3. deathweaselx86
    Replies:
    5
    Views:
    1,119
    Raymond Hettinger
    Jun 25, 2011
  4. Warren Brown
    Replies:
    3
    Views:
    247
    Aredridel
    Jul 24, 2004
  5. Token Type
    Replies:
    9
    Views:
    365
    Chris Angelico
    Sep 9, 2012
Loading...

Share This Page