Table of Contents

RequiredRule

Input validation rule that tests for a field. Mandates that the field exists; is required.

An “I agree to these terms and conditions” checkbox would be a good example candidate for a RequiredRule.

Example

$form->addRule (new RequiredRule ('fieldName'));

This example checks that the field “fieldName” exists.

Additional Information