Welcome Guest, Not a member yet? Register   Sign In
Form validation don't work
#3

(This post was last modified: 06-20-2017, 01:12 PM by Martin7483.)

As Wouter60 pointed out, both fields are named password

Code:
<input name="password" value="" id="password_id" type="text">
<input name="password" value="" id="password_id" type="text">

Both fields also have the same ID. ID's in HTML must always be unique.
Besides being required, repeat password should also be set to match the password field

Code:
<input name="password" value="" id="password_id" type="text">
<input name="password_repeat" value="" id="password_repeat_id" type="text">

And set your rules like this
PHP Code:
$this->form_validation->set_rules('password''Password''required');
$this->form_validation->set_rules('password_repeat''Password Confirmation''required|matches[password]'); 

Example from documentation
https://www.codeigniter.com/user_guide/l...ding-rules
Reply


Messages In This Thread
Form validation don't work - by pippuccio76 - 06-20-2017, 12:03 PM
RE: Form validation don't work - by Wouter60 - 06-20-2017, 12:54 PM
RE: Form validation don't work - by Martin7483 - 06-20-2017, 01:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB