如果采用Ajax验证方法,可以你在填完一些信息后,再输入验证码,尽管输入正确,也会提示"验证码不正确",这是因为captcha的默认测试次数是3次,你可以设置大一点
public function actions(){
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xFFFFFF,
'testLimit'=>999, //这里可以设置大一些,以免验证超过三次会出错.
),
);}