sridhar golyandla Posted December 1, 2008 Share Posted December 1, 2008 hi 2 all, i am new to php and mysql... please any body can help me out, egarly waiting for the solution... how to active and deactivate the 2nd and 3rd dropdown boxes for selecting a particular first dropdown value. the 2nd and 3rd dropdowns are related to 1st dropdown and the values are posted from backend ie DB. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted December 1, 2008 Share Posted December 1, 2008 Example JavaScript: function seled(){ var d1= document.getElementById("drop1"); var d2= document.getElementById("drop2"); var d3= document.getElementById("drop3"); if(d1 != ''){ d2.enabled = true; d3.enabled = true; }else{ d2.enabled = false; d3.enabled = false; } } Example HTML: <form action="javascript:void(0);" method="post"> <select onchange="seled()" id="drop1"> <option value="">Select Value</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <select onchange="seled()" id="drop2"> <option value="">Select Value</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <select onchange="seled()" id="drop3"> <option value="">Select Value</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> </form> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.