HTML_QuickForm::addFormRule()

HTML_QuickForm::addFormRule() -- Adds a global validation rule

Synopsis

require_once 'HTML/QuickForm.php';

void HTML_QuickForm::addFormRule (mixed $rule)

Beschreibung

This should be used when you want to add a rule involving several fields or if you want to use some completely custom validation for your form. The rule function/method should return TRUE in case of successful validation and array('element name' => 'error') when there were errors.

Parameter

mixed $rule

A valid callback

Fehler-Meldungen

Tabelle 42-1. Mögliche Fehler-Arten

Error codeError messageReasonSolution
QUICKFORM_INVALID_RULECallback function does not exist in HTML_QuickForm::addFormRule()Tried to pass a name of a non-existant function as a callbackCheck spelling

Hinweise

since 3.1

Diese Methode kann nicht statisch aufgerufen werden.

Beispiel