Form Validator Plugin
The Form Validator Plugin is used to extend and customize the validation of submitted data for form elements in Joget. It enables you to implement custom validation logic to ensure data accuracy before submission. A functional Form Validator plugin must extend either the org.joget.apps.form.model.FormValidator or org.joget.apps.form.model.FormMultiRowValidator abstract class, depending on the validation needs.
Abstract Class
org.joget.apps.form.model.FormValidator
- Under
wflow-core
module. - Extended org.joget.plugin.base.ExtDefaultPlugin. Please refer to Plugin Base Abstract Class and Interface.
- Implemented org.joget.plugin.property.model.PropertyEditable. Please refer to Plugin Base Abstract Class and Interface.
- Base class for implementations to validate values for an element.
Abstract Methods
validate
public abstract boolean validate(org.joget.apps.form.model.Element element, org.joget.apps.form.model.FormData data, java.lang.String[] values)
Validate the submitted values for an element.
Overridable Methods
getElementDecoration
public java.lang.String getElementDecoration()
Return the HTML decoration for the attached element, e.g. marking a required field.
getElementDecoration
public java.lang.String getElementDecoration(org.joget.apps.form.model.Element element, org.joget.apps.form.model.FormData formData)
Return the HTML decoration for the attached element, e.g. marking a required field.
Utility Methods
getElement
public org.joget.apps.form.model.Element getElement()
Gets Element that this validator is tied to.
setElement
public void setElement(org.joget.apps.form.model.Element element)
Sets Element that this validator is tied to.
org.joget.apps.form.model.FormMultiRowValidator
- Under
wflow-core
module. - Extended org.joget.plugin.base.ExtDefaultPlugin. Please refer to Plugin Base Abstract Class and Interface.
- Implemented org.joget.plugin.property.model.PropertyEditable. Please refer to Plugin Base Abstract Class and Interface.
- Base class for implementations to validate multi row data for an element e.g. Grid.
Abstract Methods
validate
public abstract boolean validate(org.joget.apps.form.model.Element element, org.joget.apps.form.model.FormData data, org.joget.apps.form.model.FormRowSet rows)
Validate the submitted rows for an element.
Overridable Methods
getElementDecoration
public java.lang.String getElementDecoration()
Return the HTML decoration for the attached element, e.g. marking a required field.
getElementDecoration
public java.lang.String getElementDecoration(org.joget.apps.form.model.Element element, org.joget.apps.form.model.FormData formData)
Return the HTML decoration for the attached element, e.g. marking a required field.
Utility Methods
getElement
public org.joget.apps.form.model.Element getElement()
Gets Element that this validator is tied to.
setElement
public void setElement(org.joget.apps.form.model.Element element)
Sets Element that this validator is tied to.
Plugin Properties Options
-
Please refer to Plugin Properties Options for more information.
Tutorials
Related Community Plugins
- Bean Shell Validator
org.joget.apps.form.lib.BeanShellValidator (wflow-core) - Bean Shell Multirow Validator
org.joget.apps.form.lib.BeanShellMultiRowValidator (wflow-core) - Default Validator
org.joget.apps.form.lib.DefaultValidator (wflow-core) - Duplicate Value Validator
org.joget.apps.form.lib.DuplicateValueValidator (wflow-core)