I have form and two dropdown select list. I want make them dependent each other. That means if a option selected from one select list then other dropdown select list will be blank. I think its simple in JavaScript but I can't make it. PLEASE HELP ME. Thanks
Ok, you can do like this: <html> <head> <script type="text/javascript"> function someFunction(p_sDomId) { document.getElementById(p_sDomId).selectedIndex = 0; }; </script> </head> <body> <form method="post"> <select id="boxA" onchange="someFunction('boxB')"> <option>-</option> <option value="A1">A</option> <option value="A2">B</option> <option value="A3">C</option> <option value="A4">D</option> </select> <select id="boxB" onchange="someFunction('boxA')"> <option>-</option> <option value="B1">A</option> <option value="B2">B</option> <option value="B3">C</option> <option value="B4">D</option> </select> </form> </body> Code (markup):