Enable/disable validation of a field in a form

5
I've created a form with a reference selector/dropdown. When I choose a value from the reference selector/dropdown (in the client/browser) I would like the properties of another field to be changed (read-only, required, another kind of validation or class(style)). For example: when I choose a different value from reference-selector-1 (in the client/browser), I want field-2 to become required and field-3 to become read-only. How can I do this in the current version (2.4.6)? If it is not possible: will it be possible in the next version (2.5)?
asked
1 answers
3

In 2.4.6 this can be solved rather complex.

The solution I could think of is, since it is possible to make fields read-only based on an enumeration value, by triggering a microflow that sets a dummy enumeration when the reference selector is changed. When you give this dummy enumeration two values, one for read-only and one for normal and use this in your form it could be solved.

For other types of validation like required you could use a before commit microflow. When the object doesn't conform the validation (you can check this in your micoflow) you can trigger a validation with the 'Send validation message' activity and return false in your microflow (this means the object won't be committed).

I don't know if this will be easier in 2.5, maybe someone else could give that answer. Anyhow, I hope this will help you. Good luck!

answered