[Feature Request]Intelligently firing the 'required' validation

Hi, Sample usecase : First question : Patient Previously Treated for TB : Yes | No Subsequent questions on previous treatment of TB. If the answer to the first question is Yes then the subsequent questions must be answered. If the answer is No then of course the subsequent question can be skipped.

i have set the required validation through visit.json on subsequent question and enable/disable them using formConditions.js based on what was the answer to first question was. However the required validation gets fired even if the questions are disabled.

The required validation should be skipped if the question itself is disabled. or may be there is a better / different way to achieve this? This could be applicable for any type of validation i suppose

1 Like

I think this is a very valid scenario and should be looked at. I would like to extend this a bit further to cover couple of scenarios.

  • A form has a series of options to be selected, one of the options is “Other”. Now, if the user selects other then I want to make the field “Specify Other” as mandatory
  • There are multiple form fields which can be filled and are not disabled. However, if a user provides input to one field then another field becomes mandatory (which was optional otherwise)
1 Like

We get a lot of small improvement requirements around forms. I have added these along with that.