PageRenderTime 33ms CodeModel.GetById 25ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 1ms

/lib/jquery-validate/demo/captcha/captcha.js

#
JavaScript | 27 lines | 25 code | 2 blank | 0 comment | 0 complexity | 02a6ed487354e9161f816f0c269c4819 MD5 | raw file
 1$(function(){
 2	$("#refreshimg").click(function(){
 3		$.post('newsession.php');
 4		$("#captchaimage").load('image_req.php');
 5		return false;
 6	});
 7	
 8	$("#captchaform").validate({
 9		rules: {
10			captcha: {
11				required: true,
12				remote: "process.php"
13			}
14		},
15		messages: {
16			captcha: "Correct captcha is required. Click the captcha to generate a new one"	
17		},
18		submitHandler: function() {
19			alert("Correct captcha!");
20		},
21		success: function(label) {
22			label.addClass("valid").text("Valid captcha!")
23		},
24		onkeyup: false
25	});
26	
27});