What is $errors( )?


$errors( )

$errors = array('fieldName'=>'Error message', 'fieldName2'=>'Error message 2');

Description #

An array where you can specify an error message for the individual fields within your form during pre-processing.

Examples #

In this example after submitting an external form an error has been returned about the email address.


 $t->submitForm( "0",
  array (
            'Address'=> $data['Address'],
            'Suburb'=> $data['Suburb'],
             'City'=> $data['City'],
             'Email'=> $data['email']
             'ok' => 'Submit',

if ($t->contains("This E-mail address has already been registered.")) {
 $errors = array('email'=>'This E-mail address has already been registered');