diff options
Diffstat (limited to 'bug/bug/jquery-validation-1.8.1/demo/captcha/captcha.js')
-rw-r--r-- | bug/bug/jquery-validation-1.8.1/demo/captcha/captcha.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/bug/bug/jquery-validation-1.8.1/demo/captcha/captcha.js b/bug/bug/jquery-validation-1.8.1/demo/captcha/captcha.js new file mode 100644 index 0000000..245bc45 --- /dev/null +++ b/bug/bug/jquery-validation-1.8.1/demo/captcha/captcha.js @@ -0,0 +1,27 @@ +$(function(){ + $("#refreshimg").click(function(){ + $.post('newsession.php'); + $("#captchaimage").load('image_req.php'); + return false; + }); + + $("#captchaform").validate({ + rules: { + captcha: { + required: true, + remote: "process.php" + } + }, + messages: { + captcha: "Correct captcha is required. Click the captcha to generate a new one" + }, + submitHandler: function() { + alert("Correct captcha!"); + }, + success: function(label) { + label.addClass("valid").text("Valid captcha!") + }, + onkeyup: false + }); + +}); |