How does Front-End and Back-end form field validation work?

Looking at: https://docs.camunda.org/manual/7.4/user-guide/task-forms/#form-field-validation

First line of docs says "Validation can be used for specifying front-end and backend validation of form fields. "

Looking to build some generic custom validators, but docs are not clear on how front-end vs back-end validations are build in the custom validator.

Anyone have experience with this or anyone can camunda point me in the right direction?

Hi,

front-end validation in forms is able to highlight wrong user input and disable the input button. This is useful to give the user some immediate feedback when entering values in the form. Front-end validation does not prevent the user from submitting a task-form with incorrect values (e.g. by doing the REST request manually).

This is where back-end validation comes into play. This checks the submitted variable values against the validator and rejects the form submission if the value does not match the validator.

The custom validator that is part of the documentation is a back-end validator. There will be no highlighting of incorrect values in the front-end. You would have to implement this front-end validation logic with Javascript e.g. within the embedded forms.

Does this help you?

Cheers
Sebastian

@sebastian.stamm! Ahh! See the docs sort of (and i guess i was secretly wishing :smile: ) that the validators supported injecting code into the HTML of the forms for front-end validation, and you could create front-end and back-end validation with a single validator and a single configuration in the modeler/bpmn.

:slight_smile:

Thanks