Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Deselect values in list boxes

Deselect values in list boxes

Deselect values in list boxes


I have 3 list boxes and whenever I select a value in one list box the values in the other 2 list boxes should be deselected in case if any of them are selected. Please let me know your suggestions. I already posted this on vbscript forum but I didn't get any response

I wrote the following, which is not working. I'm populating the values in the select boxes during window load
<!DOCTYPE html>


BORDER = "Thick"


<title>test project</title>


function Check(intValue)

Select Case intValue

Case 0
For Each objOption in txt1.Options
If objOption.Selected Then
txt2.disabled = true
txt3.disabled = true
txt2.disabled = false
txt3.disabled = false

End If

Case 1

For Each objOption in txt2.Options

If objOption.Selected Then

txt1.disabled = true
txt3.disabled = true

txt1.disabled = false
txt3.disabled = false

End If
Case 2

For Each objOption in txt3.Options

If objOption.Selected Then
txt1.disabled = true
txt2.disabled = true

txt1.disabled = false
txt2.disabled = false

End If
End Select

End Function
End Sub


<p class="para1"> Select A value txt1 </p><BR><BR>
<select class="txt1" id="txt1" size="2" name=txt1 onchange="Check(0)">


<p class="para1"> Select A value txt2 </p><BR><BR>
<select class="txt2" id="txt2" size="2" name=txt2 onchange="Check(1)">

<p class="para3"> Select A value txt3 </p><BR><BR>
<select class="txt3" id="txt3" size="2" name=txt3 onchange="Check(2)">



RE: Deselect values in list boxes

3 options - only 1 can be selected.

sounds like radio buttons much ? ^_^

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close