how to refresh Yii captcha when validation failed? -
how refresh yii captcha word image when validation failed ? here's code
jquery.ajax({ type : "post", cache : false, url : emailfrienddata, data : 'friendemail='+friendemail+'&sendername='+sendername+'&friendemailcontent='+friendemailcontent+"&captcha="+captcha, success :function(data){ if(data == 1){ alert('email sent'); jquery.fancybox.close(); } else if(data == 2) { alert('wrong captcha!'); //how refresh yii captcha in area ? return false; } } }); return false; }
you can trigger click on refresh button. if put captcha in container class captcha could:
$(".captcha a").trigger("click");
Comments
Post a Comment