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AUjyRocUK7XlgAkmdHkXWuj3PZcb2fd641ySid7fioC1aelwlrsi5YADLBbdNkLI+5GIFD7lvsqADCPI8sjE0gO1rStFjNHnQNpPk0ToOEIgQIwBT2kZSmYhoJcaDM6Nsm4eCkElMQKjOF9OmSmthmbUyZlsrtHKlaSADq0DwAgLMw/Vyoq7AmN0/zIDIuRYga31A1G3e6l84dYP3j+ptUyJt525D+s2yAlbwA730DZ7VsyTJXSMEOoisKW8BcPggyauAquINAdiWPi+IACwAKKPI8KduAAnNwACO7WhDYfA8JiugiCXmCQFAEEAuGei0AAjAADMIYh2DXassRU3pAA

Form field validation


When a custom form is used, you can use the following function to get all values from that form and also the information if it is valid:


_c2._base.getFormValues("#<customform id>")


On each of the fields on that form, you can add the following JSON field (entry) to add a validation:


fldvalidation  <string>


The fldvalidation string can contain multiple rules e.g.:

<rulename>:<value>~<rulename>:<value>

The rules are separated with a ~


rulenames:


  • pattern_test
    the value can be a regex that tests the value(s) against.
    Note: if there are multiple values, ALL values are tested (e.g. checkbox and multiselect fields)

  • min_value_length
    the value is the minimum length that the value must have in order to pass validation
    Note: if there are multiple values, ALL values are tested (e.g. checkbox and multiselect fields)

  • max_value_length

    the maximum length of the value that is allowed.

    Note: if there are multiple values, ALL values are tested (e.g. checkbox and multiselect fields)


  • larger_then
    The value from the field must be larger then the validation value.
    Note:
    - if there are multiple values, ALL values are tested (e.g. checkbox and multiselect fields)
    - This is not a length test, it is a simple > test.   (  value "1" > validation value "01"   will PASS )

  • larger_or_eq_then
    see larger then

  • smaller_then
    see larger then

  • smaller_or_eq_then
    see larger then

  • equal_to
    uses === to test the value against the validation value.

  • not_equal_to
    uses !== to test the value against the validation value.

  • min_nr_of_values
    multiselects and checkboxes can have multiple values, with this settings you can determine the minimum items they should select in order to pass validation

  • max_nr_of_values
    multiselects and checkboxes can have multiple values, with this settings you can determine the maximum allowed items they can select in order to pass validation

  • values_must_contain_one_of
    This is a multivalue test, so the values must be separated by a ,


NOTE:

You can have the value of the field tested against MULTIPLE rules.