captcha.js 547 B

123456789101112131415161718192021222324252627
  1. $(function(){
  2. $("body").on("click", "#refreshimg", function(){
  3. $.post("newsession.php");
  4. $("#captchaimage").load("image_req.php");
  5. return false;
  6. });
  7. $("#captchaform").validate({
  8. rules: {
  9. captcha: {
  10. required: true,
  11. remote: "process.php"
  12. }
  13. },
  14. messages: {
  15. captcha: "Correct captcha is required. Click the captcha to generate a new one"
  16. },
  17. submitHandler: function() {
  18. alert("Correct captcha!");
  19. },
  20. success: function(label) {
  21. label.addClass("valid").text("Valid captcha!")
  22. },
  23. onkeyup: false
  24. });
  25. });