davidkk Posted February 2, 2009 Share Posted February 2, 2009 I'm setting up a form for my uncle on his website to accept online checks. We have a HTML form that passes through php and one of the options is a radio button with the option for either personal or organizational. What I am trying to do (and not sure whether it would be through javascript or heck even css but..) is when ever the organization's check is selected the box for drivers license is greyed out, so you can only enter information in the drivers license field when personal check is selected on the radio button. Thanks in advance. -Dave Quote Link to comment https://forums.phpfreaks.com/topic/143485-greying-out-options-in-a-form-dynamically/ Share on other sites More sharing options...
davidkk Posted February 2, 2009 Author Share Posted February 2, 2009 Forgot to add in a graphic to give a better visual description. http://www.metrogreek.com/check.jpg Quote Link to comment https://forums.phpfreaks.com/topic/143485-greying-out-options-in-a-form-dynamically/#findComment-752743 Share on other sites More sharing options...
imperialized Posted February 16, 2009 Share Posted February 16, 2009 This would be done using javascript, not sure on the exact code, however if you use the OnClick event, you could do it like this <script language="javascript"> function disable() { document.form.field.disabled=true; } </script> <input type=radio value="x" OnClick="disable()"> This should be moved to the javascript section //Granted, I dont know if this will work, but it should get you headed in the right direction Quote Link to comment https://forums.phpfreaks.com/topic/143485-greying-out-options-in-a-form-dynamically/#findComment-763528 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.