![]() |
In my app I have 2 email address fields.
The first field is required because it's the main account. The second field is optional. Here are my rules currently. PHP Code: public $profile = [ But when I leave the login_email_2 field blank it complains that it's not a valid email. How can I ignore the valid email rule if the field is blank? I think I solved my own problem with permit_empty Is there a listing of all the codeigniter validation rules? I didn't see them singled out in the docs.
You can not have an email that is empty using that rule, you could check it an see if it has a value
in your code then set it to permit_empty and remove the valid_email one check it in your code. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |