Welcome Guest, Not a member yet? Register   Sign In
Validation failing on empty fields even when not required
#1

I keep my validation rules in App/Config/Validation

I have one of my rules set as:
PHP Code:
'topic' => [
            'rules' => 'alpha_numeric_punct',
        ], 

When the 'topic' field is let blank it fails validation despite 'required' not being set as a rule.

If I remove the validation rule completely then the validation passes as it should, but this means that there is no validation on the field. 
The same behaviour exists on all my fields. 

I thought fields were not required by default (otherwise, why would we need the 'required' rule). 

I would really appreciate any explanation or suggestion.
Reply


Messages In This Thread
Validation failing on empty fields even when not required - by motownphilippe - 02-19-2021, 06:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB