Jump to content

Greying out options in a form dynamically


davidkk

Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.