nikhar021 Posted April 9, 2008 Share Posted April 9, 2008 how can i enable a dropdown list only when a particular radio button is selected by using php?????? Link to comment https://forums.phpfreaks.com/topic/100355-regarding-radio-buttons/ Share on other sites More sharing options...
Kieran Menor Posted April 9, 2008 Share Posted April 9, 2008 You can't. This type of thing is what Javascript is for. I suppose you would give your dropdown box an id and then use onclick on the radio buttons enable/disable the dropdown list. Something like: <form action="formprocessor" method="post"> <input type="radio" name="testelement" value="abc" onclick="document.getElementById("mydropdownbox").disabled='true';">i disable<br> <input type="radio" name="testelement" value="123" onclick="document.getElementById("mydropdownbox").disabled='true';">i disable too<br> <input type="radio" name="testelement" value="def" onclick="document.getElementById("mydropdownbox").disabled='false';">select me to enable the box<br> <select name="dropbox" id="mydropdownbox" disabled="disabled"> <option>Option 1</option> <option>Option 2</option> </select> </form> Link to comment https://forums.phpfreaks.com/topic/100355-regarding-radio-buttons/#findComment-513143 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.