-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
51 lines (46 loc) · 1.67 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<title>jValidate Examples</title>
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.jvalidate.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('form').validate();
$('form').validateOnChange();
$('form').submit(function() {
if($('form :invalid').length != 0) {
alert('Some forms are invalid');
} else {
alert('all forms are fine');
}
return false;
});
});
</script>
<style type="text/css">
dd.valid {
background: transparent url(http://www.famfamfam.com/lab/icons/silk/icons/accept.png) no-repeat scroll right center;
width: 200px;
}
dd input {
width: 175px;
}
</style>
</head>
<body>
<h1>jValidate Examples</h1>
<p>Below is a form for you to test jValidate on, if you have firebug or a similar javascript console installed you can play about with the selectors too.</p>
<form action="#" method="post">
<dl>
<dt>Name:</dt>
<dd><input type="text" name="name" rel="[2]" /></dd>
<dt>Email:</dt>
<dd><input type="text" name="email" class="email permanent" /></dd>
<dt>Username:</dt>
<dd><input type="text" name="username" rel="[5, 10]" /></dd>
<dt><input type="submit" value="Submit" /></dt>
</dl>
</form>
</body>
</html>