Question

I'm using data_verification to check the values from the post array as follows...

if ($_POST)
    {
        $validate_array = array(
            'recipe_name'       => array('string', false, 5, 25),
            'boil_length'       => array('num', false, 0, 200),

            );

            //Validate the data
            $error = validate_data($data, $validate_array); 

Using the "boil_length" as an example, if I enter "blah" into the field... it gets accepted. If I change the accepted min value to 1 then it works as expected... but this then stops the users from being allowed to use 0 (which can be the case).

Am I missing something, or is this the way it works?

Was it helpful?

Solution

Setting option to "true" and the minimum value to 1 sorts the issue. This allows 0, but doesn't allow blank or text.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top