Reputation: 564
I am try to implement retype password field in my registration form. but unfortunately i didn't work for me. please help me.
public $repeatpassword;
public function rules() {
[['Fname','Lname','username','email', 'password'], 'required'],
[['password'],'string', 'min' => 3],
[['repeatpassword'],'required'],
['repeatpassword', 'compare','compareAttribute'=>'password',
'message'=>"Passwords don't match", 'on' => 'create']
}
Upvotes: 1
Views: 214
Reputation: 250
Try this:
['repeatpassword', 'compare', 'compareAttribute' => 'password',
'message'=>"Passwords don't match"]
Upvotes: 1