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

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

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

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)
 
Created by Damian Last modified by Aadrian on Dec 20, 2024