如果採用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, //這裏可以設置大一些,以免驗證超過三次會出錯.
),
);}