This project is no longer maintained and no further public releases are planned.

No further support will be given.

Feel free to fork the git repository.

Validator\DefaultValidator

This is the default Validator. It supports all available error checks.

Version added

1.0.0

TypoScript path

plugin.Tx_Formhandler.settings.validators.x copy to clipboard

Properties

.disableErrorCheckFields

List of field names which should not get validated.

Use the special value 'all' to disable all error checks.

Since Version 2.0 you can disable specific error checks. See the example code below.

Data type

Comma separated list | cObj

Version added

1.0.0

Example code

disableErrorCheckFields = firstname,lastname
disableErrorCheckFields = all

#Since Version 2.0 you can disable specific error checks:

validators {
    1.class = Validator\DefaultValidator
    1.config {
        disableErrorCheckFields {
            name = maxLength
            email = email
        }
    }
}

#This disables the check "maxLength" for field name and the check "email" for the field email.

#If you want to disable all checks for a field, just leave the value empty:

validators {
    1.class = Validator\DefaultValidator
    1.config {
        disableErrorCheckFields {
            name = 
            email = email
        }
    }
}

#This disables all checks for the field name.

#The old syntax is still compatible, but cannot be mixed with the new one.

disableErrorCheckFields = name,email

.restrictErrorChecks

List of error checks to perform. If this is set, only these error checks will be executed, all other configured error checks will be ignored.

Data type

Comma separated list | cObj

Version added

1.0.0

.fieldConf

Array of fields to validate

Data type

Array

Version added

1.0.0

.fieldConf.[fieldname].

Array containing the error check options.

Data type

Array

Version added

1.0.0

Example code

fieldConf {
  name {
    errorCheck {
      1 = required
      2 = maxLength
      2.value = 50
    }
  }
  email {
    errorCheck {
      1 = required
      2 = email
    }
  }
}

.messageLimit

Limits the number of error messages for all and/or specific fields.

Data type

Integer - cObj

Version added

1.0.0

Example code

#Limit messages to 1 for each field:
messageLimit = 1
#Heighten limit for one field
messageLimit.upload = 5