Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to determine whether the user has already selected an option from a multi select list

Reply
Thread Tools

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

 
 
Patrick Olurotimi Ige
Guest
Posts: n/a
 
      02-23-2005
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!
 
Reply With Quote
 
 
 
 
MasterGaurav
Guest
Posts: n/a
 
      02-23-2005
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
--------------------------------

 
Reply With Quote
 
 
 
 
Patrick Olurotimi Ige
Guest
Posts: n/a
 
      02-23-2005
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!
 
Reply With Quote
 
MasterGaurav
Guest
Posts: n/a
 
      02-23-2005
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
--------------------------------

 
Reply With Quote
 
Patrick Olurotimi Ige
Guest
Posts: n/a
 
      02-24-2005
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!
 
Reply With Quote
 
MasterGaurav
Guest
Posts: n/a
 
      02-24-2005
No. None of the multiple-items / list allow this.

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------

 
Reply With Quote
 
=?Utf-8?B?TmljZW1hbg==?=
Guest
Posts: n/a
 
      03-11-2005
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!
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
selected=selected in the center of option list John HTML 5 03-01-2010 08:30 PM
Reset Selected Item in Select Option List Dennis Marks HTML 1 09-08-2006 08:21 PM
Reset Selected Item in Select Option List Dennis Marks Javascript 0 09-08-2006 05:31 PM
Dynamically update SELECTED option in option list Mark Kolber Javascript 4 01-01-2005 02:07 PM
Selection from One SELECT changes selected option of another SELECT? J. Hall HTML 2 04-21-2004 05:36 PM



Advertisments