invalidate()

clonefish->invalidate() - invalidates the form

Description

class clonefish{
  void invalidate( void )
}

Invalidates the form. It can be used to invalidate the form even if the validation of the form elements was successful. Ideal for handling very complicated validations outside clonefish (though you can also use the custom (user-defined) validation). After invalidating a form, a repeated validation will always fail.

Most of the time clonefish->invalidate() is used together with clonefish->addMessage() to specify an error message.

Examples

<?php

if ( $clonefish->validate() ) {

  if ( 
something_bad_happened() )
    
$clonefish->invalidate();

  if ( 
$clonefish->validate() ) {
    echo 
'everything\'s OK';
  else {
    
// we could still get false
    
echo 'something bad happened!';
  }

}

?>

form validation for developers!

clonefish is a proven, mature form generator class that helps PHP developers to create, validate and process secure, flexible and easy-to-maintain forms
learn more
Bookmark and Share