How to determine whether the user has already selected an option from a multi select list

Discussion in 'ASP .Net' started by Patrick Olurotimi Ige, Feb 23, 2005.

  1. I would like to capture when a user has already selected an option from
    a multi select list / or Textbox
    So for example if a user selects a value 3 using a dropdown list or by
    inputing a value it shouldn't be allowed to select 3 again only values 2
    and 1.
    using a rated 1 to 3 in order of preference)


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige, Feb 23, 2005
    #1
    1. Advertising

  2. Patrick Olurotimi Ige

    MasterGaurav Guest

    No. You cannot disable selection of any specific items in Multi-Select
    ListBox.

    However, you can do a lengthy trick:

    1. Add an onchange (client-side) event to the DDL
    2. Whenever the value is changed, repopulate the Multi-Select ListBox
    with all items except the one selected in DDL.

    ^^ This can also be done on server side -- use autopost back.

    It's a little tricky and lengthy. I would suggest you handle it on the
    serverside by manipulating the selected value.


    --
    Cheers,
    Gaurav Vaish
    http://www.mastergaurav.org
    http://mastergaurav.blogspot.com
    --------------------------------
    MasterGaurav, Feb 23, 2005
    #2
    1. Advertising

  3. About doing this with Client Side scripting i.e Jscript?




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige, Feb 23, 2005
    #3
  4. Patrick Olurotimi Ige

    MasterGaurav Guest

    JScript or Javascript?

    In anycase, the whole idea is... the MultiSelect ListBox does not
    support disabling of any one entry. This is not in HTML specifications.

    So, it doesn't matter how you try, it will never happen.

    --
    Cheers,
    Gaurav Vaish
    http://www.mastergaurav.org
    http://mastergaurav.blogspot.com
    --------------------------------
    MasterGaurav, Feb 23, 2005
    #4
  5. Hi Gaurav,
    But is it possible if it isn't MultiSelect?
    It could be a dropdown list or even a textbox.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige, Feb 24, 2005
    #5
  6. Patrick Olurotimi Ige

    MasterGaurav Guest

    MasterGaurav, Feb 24, 2005
    #6
  7. RE: How to determine whether the user has already selected an option f

    Why not use OnChange, if the user chooses the already selected alternative
    there is no change...
    /N

    "Patrick Olurotimi Ige" wrote:

    > I would like to capture when a user has already selected an option from
    > a multi select list / or Textbox
    > So for example if a user selects a value 3 using a dropdown list or by
    > inputing a value it shouldn't be allowed to select 3 again only values 2
    > and 1.
    > using a rated 1 to 3 in order of preference)
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    >
    =?Utf-8?B?TmljZW1hbg==?=, Mar 11, 2005
    #7
    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. J. Hall
    Replies:
    2
    Views:
    1,058
    Jeff Thies
    Apr 21, 2004
  2. John
    Replies:
    5
    Views:
    986
    dorayme
    Mar 1, 2010
  3. Mark Kolber
    Replies:
    4
    Views:
    340
  4. wolverine
    Replies:
    1
    Views:
    135
    Thomas 'PointedEars' Lahn
    Aug 23, 2007
  5. wolverine
    Replies:
    0
    Views:
    108
    wolverine
    Aug 23, 2007
Loading...

Share This Page