A good script (preferably jQuery) to gray out a form if a checkbox is ticked

This seems like a pretty common task, so I feel optimistic that someone has already developed it. However, I’m not sure how to put it into Google so I thought I would ask for recommendations here.

The situation is a billing/shipping address form, with a checkbox for “billing same as shipping.” If the user ticks this checkbox, I want the billing section of the form to “gray out” - or better yet, to pull the values from the shipping section and gray out. This will enhance the user experience by avoiding confusion as to whether or not the billin part of the form still needs to be filled out.

Any suggestions for a premade solution? If there’s a jQuery plugin, that would be gravy.

I’d create a css class that styles the form however you like and add the class dynamically via onclick using jQuery’s addClass() function.

That sounds like a plan. Any ideas on the content-mirroring thing? Or can that be done directly with jQuery too?

Here’s a tutorial on how to do it.
Copying Billing and Shipping Address Information with jQuery

Wow - that looks like exactly what I need. Thanks! :slight_smile: