padmapraveen_vasili Posted July 5, 2006 Share Posted July 5, 2006 hi all,i have two check boxes A and B, they both result to a dropdown list for countries.if i check, box A it shows the dropdown for A and the dropdown for for B must be disabled. and viceversa. they are mutually exclusive.and the country selected in dropdown for A should not appear in dropdown for B.i think i have explained to my level best.can any one please give the script for this issue.thanks in advance to every one.. Link to comment Share on other sites More sharing options...
aspnetguy Posted July 5, 2006 Share Posted July 5, 2006 what happens if A and B are checked? You should use radio buttons or another dropdownlist. Link to comment Share on other sites More sharing options...
padmapraveen_vasili Posted July 5, 2006 Author Share Posted July 5, 2006 i was expecting fast reply from you ASPNET guy..yes they are radio buttons, we can not select both at time, we can select only one at a time.the other gets into disable mode. they have seperate drop downs. Link to comment Share on other sites More sharing options...
aspnetguy Posted July 5, 2006 Share Posted July 5, 2006 try this <html><head> <title>How to opaque</title> <script type="text/javascript"> function ddlViewState(letter) { //disable both var ddlA = document.getElementById('ddlA'); var ddlB = document.getElementById('ddlB'); ddlA.disabled = true; ddlB.disabled = true; //enable selected ddl var selectedDdl = document.getElementById('ddl' + letter); selectedDdl.disabled = false; } </script></head><body><table> <tr> <td> <select id="ddlA"> <option value="1">One A</option> <option value="2">Two A</option> <option value="3">Three A</option> <option value="4">Four A</option> </select> </td> <td> <select id="ddlB"> <option value="1">One B</option> <option value="2">Two B</option> <option value="3">Three B</option> <option value="4">Four B</option> </select> </td> </tr></table><div> <input type="radio" name="radioGroup" value="A" onclick="ddlViewState(this.value)"/> A <br/> <input type="radio" name="radioGroup" value="B" onclick="ddlViewState(this.value)"/> B </div></body></html> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now