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. Link to comment https://forums.phpfreaks.com/topic/134972-php-and-mysql/ 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> Link to comment https://forums.phpfreaks.com/topic/134972-php-and-mysql/#findComment-703040 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.