Fork me on GitHub
<< back to Core Developers Guide Edit on GitHub

required validator

Description

RequiredFieldValidator checks if the specified field is not null.

Parameters

Examples

<validators>
    <!-- Plain Validator Syntax -->
    <validator type="required">
        <param name="fieldName">username</param>
        <message>username must not be null</message>
    </validator>
 
 
    <!-- Field Validator Syntax -->
    <field name="username">
        <field-validator type="required">
               <message>username must not be null</message>
        </field-validator>
    </field>
</validators>