I have a form that uses some JSP to hide fields and only show those needed based on the select of Yes and No questions.

Is there a way of controlling the "required" option so that I can make the fields that are visible mandatory.

At present the only option I have is a required option on the field properties which is fine for the fields that are always visible but if you get an error when you go to submit the form even if the fields aren't currently visible.

Hope that makes sense.