Skip to content
This repository
tree: 5153a418cd
Fetching contributors…

Cannot retrieve contributors at this time

file 99 lines (94 sloc) 3.368 kb
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
<!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.6.min.js" type="text/javascript">
</script>
<script src="../js/languages/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();

$("#formID").bind("jqv.form.validating", function(event){
$("#hookError").html("")
})

$("#formID").bind("jqv.form.result", function(event , errorFound){
if(errorFound) $("#hookError").append("There is some problems with your form");
})
});
</script>
</head>
<body>
<p>
This demonstration shows How the hooks work
<br/>
</p>
<div id="test" class="test" style="width:150px;">This is a div element</div>
<form id="formID" class="formular" method="post" action="">
<div id="hookError" style="color:red; font-weight:bold;height:20px;"></div>
<fieldset>
<legend>
                    
</legend>
<label>
<span>Field is required : </span>
<input value="" class="validate[required] text-input" type="text" name="req" id="req" />
</label>
<label>
                
<span>Favorite sport 1:</span>
<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>
<label>
<span>Favorite sport 2:</span>
<select name="sport2" id="sport2" multiple class="validate[required]">
<option value="">Choose a sport</option>
<option value="option1"><l i>Tennis</li></option>
<option value="option2">Football</option>
<option value="option3">Golf</option>
</select>
</label>
<br/>
validate[required]
</fieldset>
<fieldset>
<legend>
Custom
</legend>
<label>
<div> Comes with many predifined regex (phone, url, ip, email..etc) </div><a href="demoRegExp.html">[DEMO]</a>
<br/>
<span>Enter a URL : </span>
<input value="http://" class="validate[required,custom[url]] text-input" type="text" name="url" id="url" />
<br/>
validate[required,custom[url]]
</label>
</fieldset>
<fieldset>
<legend>
Equals
</legend>
<label>
<span>Password : </span>
<input value="karnius" class="validate[required] text-input" type="password" name="password" id="password" />
</label>
<label>
<span>Confirm password : </span>
<input value="kaniusBAD" class="validate[required,equals[password]] text-input" type="password" name="password2" id="password2" />
<br/>
validate[required,equals[password]]
</label>
</fieldset>
            
<input class="submit" type="submit" value="Validate &amp; Send the form!"/><hr/>
</form>
</body>
</html>
Something went wrong with that request. Please try again.