tulsantide
Technical User
Hi,
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>
<html>
<head>
<HTA:APPLICATION
APPLICATIONNAME = "Test Project"
BORDER = "Thick"
INNERBORDER = "yes"
MAXIMIZEBUTTON = "no"
MINIMIZEBUTTON = "YES"
SCROLL = "YES"
SHOWINTASKBAR = "Yes"
/>
<title>test project</title>
<SCRIPT LANGUAGE="VBScript">
function Check(intValue)
Select Case intValue
Case 0
For Each objOption in txt1.Options
If objOption.Selected Then
txt2.disabled = true
txt3.disabled = true
Else
txt2.disabled = false
txt3.disabled = false
End If
Next
Case 1
For Each objOption in txt2.Options
If objOption.Selected Then
txt1.disabled = true
txt3.disabled = true
Else
txt1.disabled = false
txt3.disabled = false
End If
Next
Case 2
For Each objOption in txt3.Options
If objOption.Selected Then
txt1.disabled = true
txt2.disabled = true
Else
txt1.disabled = false
txt2.disabled = false
End If
Next
End Select
End Function
End Sub
</SCRIPT>
</head>
<Body>
<p class="para1"> Select A value txt1 </p><BR><BR>
<select class="txt1" id="txt1" size="2" name=txt1 onchange="Check(0)">
</select><BR><BR>
<p class="para1"> Select A value txt2 </p><BR><BR>
<select class="txt2" id="txt2" size="2" name=txt2 onchange="Check(1)">
</select><BR><BR>
<p class="para3"> Select A value txt3 </p><BR><BR>
<select class="txt3" id="txt3" size="2" name=txt3 onchange="Check(2)">
</select><BR><BR>
</BODY>
</html>
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>
<html>
<head>
<HTA:APPLICATION
APPLICATIONNAME = "Test Project"
BORDER = "Thick"
INNERBORDER = "yes"
MAXIMIZEBUTTON = "no"
MINIMIZEBUTTON = "YES"
SCROLL = "YES"
SHOWINTASKBAR = "Yes"
/>
<title>test project</title>
<SCRIPT LANGUAGE="VBScript">
function Check(intValue)
Select Case intValue
Case 0
For Each objOption in txt1.Options
If objOption.Selected Then
txt2.disabled = true
txt3.disabled = true
Else
txt2.disabled = false
txt3.disabled = false
End If
Next
Case 1
For Each objOption in txt2.Options
If objOption.Selected Then
txt1.disabled = true
txt3.disabled = true
Else
txt1.disabled = false
txt3.disabled = false
End If
Next
Case 2
For Each objOption in txt3.Options
If objOption.Selected Then
txt1.disabled = true
txt2.disabled = true
Else
txt1.disabled = false
txt2.disabled = false
End If
Next
End Select
End Function
End Sub
</SCRIPT>
</head>
<Body>
<p class="para1"> Select A value txt1 </p><BR><BR>
<select class="txt1" id="txt1" size="2" name=txt1 onchange="Check(0)">
</select><BR><BR>
<p class="para1"> Select A value txt2 </p><BR><BR>
<select class="txt2" id="txt2" size="2" name=txt2 onchange="Check(1)">
</select><BR><BR>
<p class="para3"> Select A value txt3 </p><BR><BR>
<select class="txt3" id="txt3" size="2" name=txt3 onchange="Check(2)">
</select><BR><BR>
</BODY>
</html>