Please, give me an advice
If he has an item in the form that can remain empty (the user does not have to fill it in), then I have a problem with validation.
For example, I have an email item that does not need to be filled out
Code:
<input type = "text" name = "email" value = "<? php echo set_value ('email');?>" size = "50" />
But I have a validation written on it, which in my opinion should take place only when something is entered in the item.
Code:
'email' => ['label' => 'Email Address', 'rules' => 'valid_email|max_length [150]']
If I do not fill in the email and send the form, it reports the error "The Email Address field must contain a valid email address."
Can you please advise me what to do with it?
Thank you