forked from posabsolute/jQuery-Validation-Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemoFieldTypes.html
executable file
·120 lines (118 loc) · 5.22 KB
/
demoFieldTypes.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>JQuery Validation Engine</title>
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
<link rel="stylesheet" href="css/template.css" type="text/css"/>
<script src="js/jquery-1.4.4.min.js" type="text/javascript">
</script>
<script src="js/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8">
</script>
<script src="js/jquery.validationEngine.js" type="text/javascript" charset="utf-8">
</script>
<script>
jQuery(document).ready( function() {
// binds form submission and fields to the validation engine
jQuery("#formID").validationEngine();
});
</script>
</head>
<body>
<p>
<a href="#" onclick="alert('is the form valid? '+jQuery('#formID').validationEngine('validate'))">Evaluate form</a>
| <a href="#" onclick="jQuery('#formID').validationEngine('showPrompt', 'This is an example', 'pass')">Build a prompt on a div</a>
| <a href="#" onclick="jQuery('#formID').validationEngine('hide')">Close all prompts</a>
| <a href="index.html" onclick="">Back to index</a>
</p>
<p>
This demonstration shows the different HTML field types we support
</p>
<form id="formID" class="formular" method="post" action="">
<fieldset>
<legend>
Text field
</legend>
<label>
URL begin with http:// https:// or ftp://
<br/>
<span>Enter a URL : </span>
<input value="http://" class="validate[required,custom[url]] text-input" type="text" name="url" id="url" />
</label>
</fieldset>
<fieldset>
<legend>
TextArea
</legend>
<label>
URL begin with http:// https:// or ftp://
<br/>
<span>Enter a URL : </span>
<textarea class="validate[required] text-input" rows="2" cols="20" name="ta" id="ta" ></textarea>
</label>
</fieldset>
<fieldset>
<legend>
Select single
</legend>
<label>
<select name="sport" id="sport" class="validate[required]">
<option value="">Choose a sport</option>
<option value="option1">Tennis</option>
<option value="option2">Football</option>
<option value="option3">Golf</option>
</select>
</label>
</fieldset>
<fieldset>
<legend>
Select mutiple
</legend>
<label>
<select name="sport2" id="sport2" multiple="true" class="validate[required]">
<option value="">Choose a sport</option>
<option value="option1">Tennis</option>
<option value="option2">Football</option>
<option value="option3">Golf</option>
</select>
</label>
</fieldset>
<fieldset>
<legend>
Radio
</legend>
<div>
<span>Radio Groupe :
<br/>
</span>
<span>radio 1: </span>
<input class="validate[required] radio" type="radio" name="group0" id="radio1" value="5"/><span>radio 2: </span>
<input class="validate[required] radio" type="radio" name="group0" id="radio2" value="3"/><span>radio 3: </span>
<input class="validate[required] radio" type="radio" name="group0" id="radio3" value="9"/>
</div>
</fieldset>
<fieldset>
<legend>
Checkbox
</legend>
<div>
<span>Minimum 2 checkbox :</span>
<input class="validate[minCheckbox[2]] checkbox" type="checkbox" name="group1" id="maxcheck1" value="5"/>
<input class="validate[minCheckbox[2]] checkbox" type="checkbox" name="group1" id="maxcheck2" value="3"/>
<input class="validate[minCheckbox[2]] checkbox" type="checkbox" name="group1" id="maxcheck3" value="9"/>
</div>
</fieldset>
<fieldset>
<legend>
File
</legend>
<div>
<span>Please select a file:</span>
<input class="validate[required] text-input" type="file" name="file" id="file"/>
</div>
</fieldset>
<input class="submit" type="submit" value="Validate & Send the form!"/>
<hr/>
</form>
</body>
</html>