Required, but Hidden Fields - (Not) Required - Inconsistent behaviour

wm wmelis 12d ago

Dear all, 

Within a form, I have to situations where part of the form is hidden based on a choice, but for one area, the fact that it is "required" does not trigger a problem when the fields are hidden, whereas for another one it does - this seems inconsistent and I would like to know how to get the same behaviour across, as in when the field is hidden it cannot be required. 

First hidden area: 

Trigger is a drop down menu, where if a particular choice is made some fields need to be shown. The triggers are set as: on document view and then when value in equals the right entry or when value in is not to hide again. 

There are multiple fields to show, and I had put them in a "multifield" with a listener to show/hide. This worked on the show/hide side, but when trying to submit for an entry where these fields are hidden, I get an error saying you need to complete fields, which are the ones that are hidden. I then moved the listener to the field itself, thinking that the combination of the listener and the required would be clever enough to overcome this problem, but no. Even if the field remains hidden it is still required. On the field I also have a trigger that checks if the document is loaded and if so it triggers a hide for the listener.

Second hidden area: 

Trigger is a tick box, you tick it, and 2 more boxes appear, one is required, the other one is not.

However, in this case, if you do not thick the box you can simply submit the form, so it does not care about the required field. On the field that is set to "required" I have the listener, but also a trigger that ensures that on document loading it gets hidden. 

Why do these 2 areas which have required fields and are hidden at times behave differently when it comes to the required fields, while they are both part of the same form ? 

Thanks, 

Wim

Post a Reply