I built a simple registration form -
class MRegistrationForm extends CFormModel {
public $email;
public $password;
public $password2;
...
}
with several simple validation rules
public function rules()
{
return array(
array('email, password, password2', 'required'),
array('password', 'compare', 'compareAttribute'=>'password2', 'on'=>'register'), // this line is not working
array('email', 'email')
);
}
All other validation rules work, except ‘compare’ validation. I copied this line of code directly from the Guide http://www.yiiframework.com/doc/guide/1.1/en/form.model
Can you tell me what seems to be the problem? Thank you!
Regards,
Nicolas Xu