FormValidator Class Documentation

bool isEmpty ( string $field, string $msg )
$field: The form field name to be validated
$msg: A message to display to the user if the value is not valid
Returns: TRUE if the field is empty; FALSE otherwise.
bool isString ( string $field, string $msg )
$field: The form field name to be validated
$msg: A message to display to the user if the value is not valid
Returns: TRUE if the field contains a string; FALSE otherwise.
bool isNumber ( string $field, string $msg )
$field: The form field name to be validated
$msg: A message to display to the user if the value is not valid
Returns: TRUE if the field contains a number; FALSE otherwise.
bool isInteger ( string $field, string $msg )
$field: The form field name to be validated
$msg: A message to display to the user if the value is not valid
Returns: TRUE if the field contains an integer number; FALSE otherwise.
bool isFloat ( string $field, string $msg )
$field: The form field name to be validated
$msg: A message to display to the user if the value is not valid
Returns: TRUE if the field contains a float number; FALSE otherwise.
bool isWithinRange ( string $field, string $msg, int $min, int $max )
$field: The form field name to be validated
$msg: A message to display to the user if the value is not valid
$min: The minimum acceptable value
$max: The maximum acceptable value
Returns: TRUE if the value is within the $min and $max, inclusive; FALSE otherwise.
bool isAlpha ( string $field, string $msg )
$field: The form field name to be validated
$msg: A message to display to the user if the value is not valid
Returns: TRUE if the field contains ONLY alphabetic characters [a-z][A-Z]; FALSE otherwise.
bool isEmailAddress ( string $field, string $msg )
$field: The form field name to be validated
$msg: A message to display to the user if the value is not valid
Returns: TRUE if the field contains a valid e-mail address format; FALSE otherwise. (NOTE: This method does NOT test whether the address is an active address.)
bool isError ()
Returns: TRUE if any of the previous tests have found an error.
array getErrorList ()
Returns: An array of errors found in the previous tests.
void resetErrorList ()
Resets the error array to empty.
string getFormattedErrorList ()
Returns: A string which contains an HTML <div> which contains an HTML <ul> (unordered list) of the errors in the previous tests.