Best way to do captcha with an Ajax form in jquery?

I am working on a comment script using ajax, json and jquery. I have most of it done except the hardest part, If a user post X ammount of comments in X ammount of time, my php script will return a "captcha" trigger to my javascript code below, telling it that this user needs to enter a captcha code before we will post there comment to the DB Below you will see I have 3 options for a returned value: success, error, and captcha when captcha is returned, I want to open up a popup dialog on the screen and load my captcha script, so far everything works up to this point. Now I need to make the captcha script submit, not only the captcha value but also my users comment, so I just need to populate a hidden form field with the comment value. Easy enough I just havent done it yet. Now if a user get the wrong captcha value, it needs to reload the screen but popup the captcha screen again and still have the comment hidden in a form value. That is where the tricky part comes in. After reading my plan and viewing my code below, do you think I am on the right track? Any suggestions on a better way? **UPDATE:** After more thought it seems I need to make my captcha use ajax as well or else there will be a page reload =(
@jasondavis - You should edit your previous similar question and put a bounty on it. stackoverflow.com/questions/1257991/…

以上就是Best way to do captcha with an Ajax form in jquery?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏