Welcome Guest, Not a member yet? Register   Sign In
conditional form validation
#1

[eluser]felix_[/eluser]
Hey,
ive got a form validation rule which means password must be min 6 chars.
Now when the user is editing his account the password field is blank
When he submits a blank password the fields should not change but when he write something in the filed it should check if it matches the rules

so can i realize this with Form Validation Class?
Maybe something like length == 0 OR minlength==6,....

greeting
#2

[eluser]danmontgomery[/eluser]
Code:
if($this->input->post('password'))
{
    $this->form_validation->set_rules('password', 'Password', 'min_length[6]');
}

Should work




Theme © iAndrew 2016 - Forum software by © MyBB