This project has moved and is read-only. For the latest updates, please go here.

Solution to grey out columns based on yes/no

Feb 3, 2014 at 10:37 PM
Hi there,

I am using Cascading Drop-downs in a NewForm.aspx which works perfectly!

I was wondering if you also have a solution to add to this to grey out columns? So, I was hoping, when a new item is opened, there is a checkbox for yes/no. If it is ticked (yes), then one or many columns are greyed out.

Feb 4, 2014 at 2:29 PM

No, there's nothing in SPServices for this. You can do it with jQuery. When the checkbox value changes, set the disabled property of the other column(s) appropriately.

Feb 5, 2014 at 1:51 AM
Or start a Bounty and you may get your solution rather quick. :-)


Paul T.

-- Sent from Mobile

Feb 25, 2014 at 4:24 PM
If you disable fields on a New or Edit form, be sure to remove the disabled property using a PreSaveAction() or SharePoint won't store the current value of the field.
Feb 25, 2014 at 5:07 PM
Good point Geoff. Maybe the readonly attribute would be better (and apply a style (opacity: .5) to dim the fields). Readonly will still submit the input values.

Paul T