Welcome Guest, Not a member yet? Register   Sign In
Form loses style upon validation process
#5

[eluser]boltsabre[/eluser]
Off topic, but:

Code:
$this->form_validation->set_rules('email', 'email', 'trim|valid_email|required');

You don't need the 'required' validation... for 'valid_email' to validate there has to be something in the field ;-)

Unless of course you want to display an error message when the user doesn't enter anything, in which case you'd have to place 'required' before 'valid_email' - the validations run in order from left to right, and as soon as one fails CI exits that field validation with the error message relevant to the validation check that failed (this stops your application from consuming extra resources by continuing to validate a field which has already failed a previous rule).


Messages In This Thread
Form loses style upon validation process - by El Forum - 06-25-2011, 01:52 AM
Form loses style upon validation process - by El Forum - 06-25-2011, 01:56 AM
Form loses style upon validation process - by El Forum - 06-25-2011, 02:25 AM
Form loses style upon validation process - by El Forum - 06-25-2011, 02:42 AM
Form loses style upon validation process - by El Forum - 06-25-2011, 03:23 AM



Theme © iAndrew 2016 - Forum software by © MyBB