How to use capcha with jquery.validate
I am us开发者_开发知识库ing jquery.validate for checking error in form
I am using capcha comparision via remote option in jquery.validate.
First time captcha comparision done through ajax and error msg displayed if there is no error
Second time when capcha refresh ajax remote validation not done. I dont know how to handle it.
Suggest me simplest way to use capcha via ajax using jquery.validate
Thanks in Advance
The point of Captcha is that if you get it wrong, you cannot try again in order to get it right. If they allowed a repeatable "Did I get this right?" request, your Captcha provider would be allowing a huge security hole.
Fortunately, there's a workaround: have the validation code ask your server for the correctness of the Captcha. If the Captcha is incorrect, re-generate a new one. If it is correct, have the server reply with an encrypted proof (such as with HMAC) that the user did indeed get the right Captcha on that particular form.
When you receive a submission, accept it if either the captcha is valid (so that users without JS enabled can still use your site) or the proof is valid (meaning the JS validator determined that it was correct).
精彩评论