Welcome Guest, Not a member yet? Register   Sign In
a custom callback to check if the value is empty
#3

[eluser]xwero[/eluser]
the full snippet is
Code:
// Is the field required?  If not, if the field is blank  we'll move on to the next test
            if ( ! in_array('required', $ex, TRUE))
            {
                if ( ! isset($_POST[$field]) OR $_POST[$field] == '')
                {
                    continue;
                }
            }
As you can see in the comment if the field isn't required then the check is made to see if the field is non existent or an empty string.

It's true the validation library should have an option to overwrite the default error message. This is one of the things i changed in my validation library : Validate


Messages In This Thread
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 02:41 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 03:12 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 03:23 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 03:58 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 04:11 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 04:15 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 04:59 AM
a custom callback to check if the value is empty - by El Forum - 04-21-2008, 11:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB