forked from posabsolute/jQuery-Validation-Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demoSubmit.html
executable file
·96 lines (90 loc) · 4.21 KB
/
demoSubmit.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Jquery Inline Form Validation Engine</title>
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<link rel="stylesheet" href="css/template.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<!-- FRENCH LOCALISATION
<script src="js/jquery.validationEngine-fr.js" type="text/javascript"></script>
-->
<script src="js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine.js" type="text/javascript"></script>
<!-- AJAX AFTER SUCCESS TEST FONCTION
<script>function callSuccessFunction(){alert("success executed")}
function callFailFunction(){alert("fail executed")}
</script>
-->
<script>
$(document).ready(function() {
// SUCCESS AJAX CALL, replace "success: false," by: success : function() { callSuccessFunction() },
$("#formID").validationEngine({
ajaxSubmit: true,
ajaxSubmitFile: "ajaxSubmit.php",
ajaxSubmitMessage: "Thank you, we received your inscription!",
success : false,
failure : function() {}
})
$("#formID2").validationEngine({
ajaxSubmit: true,
ajaxSubmitFile: "ajaxSubmit.php",
ajaxSubmitExtraData:"name=anything",
ajaxSubmitMessage: "Thank you, we received your inscription from the second form!",
success : false,
failure : function() {}
})
//$.validationEngine.buildPrompt("#date","This is an example","error") // Exterior prompt build example
//$.validationEngine.closePrompt(".date") // Exterior prompt close example
});
</script>
</head>
<body>
<form id="formID" class="formular" method="post" action="">
<fieldset>
<legend>User informations</legend>
<label>
<span>Desired username (ajax validation, only karnius is available) : </span>
<input value="karnius" class="validate[required,custom[noSpecialCaracters],length[0,20],ajax[ajaxUser]]" type="text" name="user" id="user" />
</label>
<label>
<span>First name (ajax validation, only karnius is available): </span>
<input value="karnius" class="validate[custom[onlyLetter],length[0,100],ajax[ajaxName]] text-input" type="text" name="firstname" id="firstname" />
</label>
<label>
<span>Last name : </span>
<input value="karnius" class="validate[custom[onlyLetter],length[0,100]] text-input" type="text" name="lastname" id="lastname" />
</label>
<label>
<span>Email address : </span>
<input value="ced@hotmail.com" class="validate[required,custom[email]] text-input" type="text" name="email" id="email" />
</label>
<input class="submit" type="submit" value="Validate & Send the form!"/>
</fieldset>
</form>
<br /> <br /> <br />
<form id="formID2" class="formular" method="post" action="">
<fieldset>
<legend>User informations</legend>
<label>
<span>Desired username (ajax validation, only karnius is available) : </span>
<input value="karnius" class="validate[required,custom[noSpecialCaracters],length[0,20],ajax[ajaxUser]]" type="text" name="user2" id="user2" />
</label>
<label>
<span>First name (ajax validation, only karnius is available): </span>
<input value="karnius" class="validate[custom[onlyLetter],length[0,100],ajax[ajaxName]] text-input" type="text" name="firstname2" id="firstname2" />
</label>
<label>
<span>Last name : </span>
<input value="karnius" class="validate[custom[onlyLetter],length[0,100]] text-input" type="text" name="lastname2" id="lastname2" />
</label>
<label>
<span>Email address : </span>
<input value="ced@hotmail.com" class="validate[required,custom[email]] text-input" type="text" name="email2" id="email2" />
</label>
<input class="submit" type="submit" value="Validate & Send the form!"/>
</fieldset>
</form>
</body>
</html>