forked from soitgoes/FormWarden
-
Notifications
You must be signed in to change notification settings - Fork 0
/
convention_validation.html
39 lines (39 loc) · 1.11 KB
/
convention_validation.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
<!DOCTYPE HTML>
<html>
<head>
<script src="jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="formwarden.js" type="text/javascript"></script>
<script src="jquery.formwarden.js" type="text/javascript"></script>
<style>
.invalid input, .invalid select, .invalid textarea{
border:solid 2px #f00;
}
.invalid{
color:#f00;
}
</style>
</head>
<body>
<form method="post" action="convention_validation.html" >
<p>
<label>Company Email: <input type="text" name="company_email" /></label>
</p>
<p>
<label>Inncode: <input type="text" name="hotel_inncode" /></label>
</p>
<ul class="validation_summary">
</ul>
<input id="submit_button" type="submit" value="Go" name="submit_button"/>
</form>
<script type="text/javascript">
$(function(){
var validationOptions=
{
conventionBased:true,
validators : {"inncode":function(value){return value.match(/^\d{5}$/);}}
};
$("form").validation(validationOptions);
});
</script>
</body>
</html>