<commit_before><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Test for jQuery validate() plugin</title>
	<link rel="stylesheet" media="screen" href="css/screen.css">
	<style>
	.warning {
		color: red;
	}
	</style>
	<script src="../lib/jquery.js"></script>
	<script src="../lib/jquery.mockjax.js"></script>
	<script src="../lib/jquery.form.js"></script>
	<script src="../dist/jquery.validate.js"></script>
	<script>
	jQuery(function() {
		$.mockjax({
			url: "login.action",
			response: function(settings) {
				var user = settings.data.match(/user=(.+?)($|&)/)[1],
					password = settings.data.match(/password=(.+?)($|&)/)[1];
				if (password !== "<PASSWORD>") {
					this.responseText = "Your password is wrong (must be foobar).";
					return;
				}
				this.responseText = "Hi " + user + ", welcome back.";
			},
			responseStatus: 200,
			responseTime: 500
		});

		// show a simple loading indicator
		var loader = jQuery('<div id="loader"><img src="images/loading.gif" alt="loading..."></div>')
			.css({
				position: "relative",
				top: "1em",
				left: "25em",
				display: "inline"
			})
			.appendTo("body")
			.hide();
		jQuery().ajaxStart(function() {
			loader.show();
		}).ajaxStop(function() {
			loader.hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		});

		var v = jQuery("#form").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#result"
				});
			}
		});

		jQuery("#reset").click(function() {
			v.resetForm();
		});
	});
	</script>
</head>
<body>
<h1 id="banner"><a href="https://jqueryvalidation.org/">jQuery Validation Plugin</a> Demo</h1>
<div id="main">
	<form method="post" class="cmxform" id="form" action="login.action">
		<fieldset>
			<legend>Login Form (Enter "<PASSWORD>" as password)</legend>
			<p>
				<label for="user">Username</label>
				<input id="user" name="user" title="Please enter your username (at least 3 characters)" class="required" minlength="3">
			</p>
			<p>
				<label for="pass">Password</label>
				<input type="password" name="password" id="password" class="required" minlength "5">
			</p>
			<p>
				<input class="submit" type="submit" value="Login">
			</p>
		</fieldset>
	</form>
	<div id="result" class="warning">Please login!</div>
	<br>
	<button id="reset">Programmatically reset above form!</button><commit_msg>Demo: fix minlength validation in ajaxSubmit-integration-demo.html (#2454)<commit_after><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Test for jQuery validate() plugin</title>
	<link rel="stylesheet" media="screen" href="css/screen.css">
	<style>
	.warning {
		color: red;
	}
	</style>
	<script src="../lib/jquery.js"></script>
	<script src="../lib/jquery.mockjax.js"></script>
	<script src="../lib/jquery.form.js"></script>
	<script src="../dist/jquery.validate.js"></script>
	<script>
	jQuery(function() {
		$.mockjax({
			url: "login.action",
			response: function(settings) {
				var user = settings.data.match(/user=(.+?)($|&)/)[1],
					password = settings.data.match(/password=(.+?)($|&)/)[1];
				if (password !== "<PASSWORD>") {
					this.responseText = "Your password is wrong (must be <PASSWORD>bar).";
					return;
				}
				this.responseText = "Hi " + user + ", welcome back.";
			},
			responseStatus: 200,
			responseTime: 500
		});

		// show a simple loading indicator
		var loader = jQuery('<div id="loader"><img src="images/loading.gif" alt="loading..."></div>')
			.css({
				position: "relative",
				top: "1em",
				left: "25em",
				display: "inline"
			})
			.appendTo("body")
			.hide();
		jQuery().ajaxStart(function() {
			loader.show();
		}).ajaxStop(function() {
			loader.hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		});

		var v = jQuery("#form").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#result"
				});
			}
		});

		jQuery("#reset").click(function() {
			v.resetForm();
		});
	});
	</script>
</head>
<body>
<h1 id="banner"><a href="https://jqueryvalidation.org/">jQuery Validation Plugin</a> Demo</h1>
<div id="main">
	<form method="post" class="cmxform" id="form" action="login.action">
		<fieldset>
			<legend>Login Form (Enter "<PASSWORD>" as password)</legend>
			<p>
				<label for="user">Username</label>
				<input id="user" name="user" title="Please enter your username (at least 3 characters)" class="required" minlength="3">
			</p>
			<p>
				<label for="pass">Password</label>
				<input type="password" name="password" id="password" class="required" minlength="5">
			</p>
			<p>
				<input class="submit" type="submit" value="Login">
			</p>
		</fieldset>
	</form>
	<div id="result" class="warning">Please login!</div>
	<br>
	<button id="reset">Programmatically reset above form!</button>
{'fraction_non_alphanumeric': 0.21682712431979909, 'fraction_numerical': 0.00795311845960653, 'mean_word_length': 3.832153690596562, 'pattern_counts': {'":': 0, '<': 114, '<?xml version=': 0, '>': 114, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7304060', 'n_tokens_mistral': 1904, 'n_tokens_neox': 1617, 'n_words': 348}