Welcome Guest, Not a member yet? Register   Sign In
Extended form validation and blank fields
#1

[eluser]urrmurrmur[/eluser]
Hi,

I have extended the form validation library to add some of my own validation functions without having to resort to callbacks. It nearly works, but there's a strange behaviour which I can't figure out.

I have a new validation rule in my extended library, which should always evaluate to false (just for testing purposes). See below.

Code:
function lamosaurus( $str )
{
    $this->CI->form_validation->set_message( 'lamosaurus', 'LAMOSAURUS!' );
    return FALSE;
}

Now, when I add this function to my controller and call it as a callback, it works. If I add it to the extended library and the input field it is linked to is NOT empty, it also works. If the input field is empty, however, the rule is not executed.


Should I add my new rule to a list of validation rules which are called on empty fields, or something?


Messages In This Thread
Extended form validation and blank fields - by El Forum - 06-04-2010, 05:23 AM
Extended form validation and blank fields - by El Forum - 06-04-2010, 07:05 AM
Extended form validation and blank fields - by El Forum - 06-04-2010, 08:45 AM
Extended form validation and blank fields - by El Forum - 06-09-2010, 02:52 AM
Extended form validation and blank fields - by El Forum - 06-09-2010, 03:07 AM
Extended form validation and blank fields - by El Forum - 06-14-2010, 07:44 AM
Extended form validation and blank fields - by El Forum - 06-14-2010, 08:49 AM
Extended form validation and blank fields - by El Forum - 06-17-2010, 05:51 AM
Extended form validation and blank fields - by El Forum - 06-17-2010, 06:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB