The validateFormField hook is triggered when a form field is submitted. It passes the widget object and the form ID as arguments and expects a widget object as return value.


from Contao 2.5.0.


  1. Widget $objWidget

    Object of the current front end widget. Use it to access form field properties.

  2. int $intId

    ID of the tl_form_field record.

  3. array $arrForm

    Form configuration data from the tl_form table.

Return Value

Return the $objWidget instance after modification or your custom widget.



// config.php
$GLOBALS['TL_HOOKS']['validateFormField'][] = array('MyClass', 'myValidateFormField');

// MyClass.php
public function myValidateFormField(Widget $objWidget, $intId, $arrForm)
    if ($objWidget instanceof FormPassword)
        // Do something

    return $objWidget;

More information


See also

results matching ""

    No results matching ""