<?xml version="1.0"?>
<record><wiki id="wiki?page_id=15">
	<page_name>validateRegistrationForm</page_name>
	<page_id>15</page_id>
	<page_title>validateRegistrationForm</page_title>
	<content>==validateRegistrationForm() hook==

A hook that validates the input into the user registration form to make sure that the input is valid.

===Signature===

function validateRegistrationForm( array $values ) : mixed

====Parameters====

{| class=&quot;listing listing2&quot;
! Name
! Description
|-
| $values
| An associative array of the input values of the registration form.
|-
| returns
| Mixed. If this method returns a PEAR_Error object then the validation will fail - and the user will be asked to correct his input.
|}

===Example===

&lt;code&gt;
&lt;?php
class conf_ApplicationDelegate {
    function validateRegistrationForm($values){
        if ( $values[&apos;age&apos;] &lt; 18 ){
            return PEAR::raiseError(&quot;Sorry you must be at least 18 years old to join this site.&quot;);
        }
        return true;
    }
}
&lt;/code&gt;

===Validation via the Users table Delegate class===

Note that since the registration form is just a &quot;new record form&quot; for the users table, it is also possible (and preferred) to do validation through the users [[table delegate class]].

===See Also===

* [[afterRegister]]
* [[beforeRegister]]
* [[sendRegistrationActivationEmail]]
* [[getRegistrationActivationEmailInfo]]
* [[getRegistrationActivationEmailSubject]]
* [[getRegistrationActivationEmailMessage]]
* [[getRegistrationActivationEmailParameters]]
* [[getRegistrationActivationEmailHeaders]]</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki></record>