SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For example, in a workflow task, I might have a master field called "Approve" which, if set to "No", makes it unnecessary to complete the rest of the form (and thus makes them non-mandatory). Is there a clean way of implementing this?

share|improve this question
up vote 1 down vote accepted

For instances like that, in the past I've marked all the fields optional in the list then created a custom new/edit form and included jQuery and PreSaveAction() to do my own logic.

I'd have the Approve column visible with everything else hidden. If they select no, then they can save the form with nothing else required. If they select Yes, then the remaining hidden fields become visible.

share|improve this answer
But the user will still be able to submit the form without completing the fields, won't he? – Mihai Sep 12 '11 at 17:33
You can use validation logic on the form fields. I've used PreSaveAction() in the past to force validation on optional fields that I want to make mandatory based on conditions. – Eric Alexander Sep 12 '11 at 17:40

This really depends on how you implement the forms in the fields. If you customize them with InfoPath, you can use conditional formatting to make fields mandatory by using rules. You can set a rule like: If Field1 = "yes" then Field 2 cannot be blank. This would make it mandatory based on the answer.

share|improve this answer
Unfortunately, I'm using Visual Studio/ASP.NET. I should have specified it in the question. – Mihai Sep 12 '11 at 17:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.