Welcome Guest, Not a member yet? Register   Sign In
Form Validation and a Edit Form
#2

[eluser]LifeSteala[/eluser]
I get around this by adding a IF statement checking to see if there was any POST data for the password field. If so, apply validation rules.

See below which works for me.

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

if ($this->input->post('password'))
{    
  $this->form_validation->set_rules('password', 'Password', 'required|trim|xss_clean|max_length[32]');
  $this->form_validation->set_rules('confirm_password', 'Confirm Password', 'required|trim|xss_clean|matches[password]|max_length[32]');
}


Messages In This Thread
Form Validation and a Edit Form - by El Forum - 04-02-2012, 12:09 PM
Form Validation and a Edit Form - by El Forum - 04-02-2012, 09:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB