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.

How to use AJAX validation

To validate each field at the moment the user leaves the field, you have to add an AjaxHandler to your TypoScript:

plugin.Tx_Formhandler.settings {
  ajax {
    class = Tx_Formhandler_AjaxHandler_JQuery
    config {
      notOk = <span class="notok">&nbsp;</span>
      ok = <span class="ok">&nbsp;</span>
      initial = <span class="###is_error_###fieldname######">&nbsp;</span>
      loading = <img src="fileadmin/templates/images/loader.gif" />
    }
  }
}

The handler in this example uses the jQuery library.

As you can see, you can specify the initial content, the content while loading and the content if the check was OK/not OK via TypoScript. This content will be inserted in markers like ###validate_[fieldname]######validate_[fieldname]###.

Example:

<label for="contact_name">###LLL:label_name######required_name###</label><br />
<input class="input" id="contact_name" type="text" name="contact[name]" value="###value_name###" />
###validate_name###

The AJAX validation will use the error checks defined in the “fieldConf” section of Tx_Formhandler_Validator_DefaultValidator\DefaultValidator.


to top