Файл: module-assets/admin/validation-engine/demos/demoMultipleForms.html
Строк: 227
<?php
<!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.8.2.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("#formID1").validationEngine('attach', {promptPosition : "centerRight", autoPositionUpdate : true});
jQuery("#formID2").validationEngine('attach', {promptPosition : "bottomLeft", autoPositionUpdate : true});
jQuery("#formID3").validationEngine('attach', {promptPosition : "bottomRight", autoPositionUpdate : true});
jQuery("#formID4").validationEngine('attach', {promptPosition : "topLeft"});
});
</script>
</head>
<body>
<p>
<a href="#" onclick="alert('is the form valid? '+jQuery('#formID1').validationEngine('validate'))">Evaluate form</a>
| <a href="#" onclick="jQuery('#formID1').validationEngine('hideAll')">Close all prompts</a>
| <a href="../index.html" onclick="">Back to index</a>
</p>
<p>
This demonstration shows the use of multiple forms on the same page.<br/>
Note: field ids MUST be unique across the page
</p>
<table width="100%">
<tbody>
<tr>
<td>
<form id="formID1" class="formular" method="post" action="">
<fieldset>
<legend>
Phone
</legend>
<label>
+103-304-340-4300-043
<br>
+1 305 768 23 34 ext 23
<br>
+1 (305) 768-2334 extension 703
<br>
+1 (305) 768-2334 x703
<br>
04312 / 777 777
<br>
01-47.34/32 56
<br>
(01865) 123456
<br>
<span>Phone : </span>
<input value="+1 305 768 23 34 ext 23 BUG" class="validate[required,custom[phone]] text-input" type="text" name="telephone6" id="telephone6" />
</label>
</fieldset>
<fieldset>
<legend>
URL
</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>
Email
</legend>
<label>
<span>Email address : </span>
<input value="forced_error" class="validate[required,custom[email]] text-input" type="text" name="email" id="email" />
</label>
</fieldset>
<fieldset>
<legend>
IP Address
</legend>
<label>
<span>IP: </span>
<input value="192.168.3." class="validate[required,custom[ipv4]] text-input" type="text" name="ip" id="ip" />
</label>
</fieldset><input class="submit" type="submit" value="Validate & Send the form!" />
<a href="#" onclick="$('#formID1').validationEngine('hide'); return false;">Hide prompts</a>
<hr/>
</form>
</td>
<td>
<form id="formID2" class="formular" method="post" action="">
<fieldset>
<legend>
Date
</legend>
<label>
ISO 8601 dates only YYYY-mm-dd
<br>
<span>Date: </span>
<input value="201-12-01" class="validate[required,custom[date]] text-input" type="text" name="date6" id="date6" />
</label>
</fieldset>
<fieldset>
<legend>
Number
</legend>
<label>
a signed floating number, ie: -3849.354, 38.00, 38, .77
<br>
<span>Number: </span>
<input value="-33.87a" class="validate[required,custom[number]] text-input" type="text" name="number" id="number" />
</label>
</fieldset>
<fieldset>
<legend>
Integer
</legend>
<label>
an signed integer: ie +34, 34 or -1
<br>
<span>Number: </span>
<input value="10.1" class="validate[required,custom[integer]] text-input" type="text" name="integer" id="integer" />
</label>
</fieldset><input class="submit" type="submit" value="Validate & Send the form!" /><hr/>
</form>
</td>
</tr>
<tr>
<td>
<form id="formID3" class="formular" method="post" action="">
<fieldset>
<legend>
Phone
</legend>
<label>
+103-304-340-4300-043
<br>
+1 305 768 23 34 ext 23
<br>
+1 (305) 768-2334 extension 703
<br>
+1 (305) 768-2334 x703
<br>
04312 / 777 777
<br>
01-47.34/32 56
<br>
(01865) 123456
<br>
<span>Phone : </span>
<input value="+1 305 768 23 34 ext 23 BUG" class="validate[required,custom[phone]] text-input" type="text" name="telephone6" id="telephone2" />
</label>
</fieldset>
<fieldset>
<legend>
URL
</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="url2" id="url2" />
</label>
</fieldset>
<fieldset>
<legend>
Email
</legend>
<label>
<span>Email address : </span>
<input value="forced_error" class="validate[required,custom[email]] text-input" type="text" name="email2" id="email2" />
</label>
</fieldset>
<fieldset>
<legend>
IP Address
</legend>
<label>
<span>IP: </span>
<input value="192.168.3." class="validate[required,custom[ipv4]] text-input" type="text" name="ip2" id="ip2" />
</label>
</fieldset><input class="submit" type="submit" value="Validate & Send the form!" /><hr/>
</form>
</td>
<td>
<form id="formID4" class="formular" method="post" action="">
<fieldset>
<legend>
Date
</legend>
<label>
ISO 8601 dates only YYYY-mm-dd
<br>
<span>Date: </span>
<input value="201-12-01" class="validate[required,custom[date]] text-input" type="text" name="date" id="date3" />
</label>
</fieldset>
<fieldset>
<legend>
Number
</legend>
<label>
a signed floating number, ie: -3849.354, 38.00, 38, .77
<br>
<span>Number: </span>
<input value="-33.87a" class="validate[required,custom[number]] text-input" type="text" name="number2" id="number2" />
</label>
</fieldset>
<fieldset>
<legend>
Integer
</legend>
<label>
an signed integer: ie +34, 34 or -1
<br>
<span>Number: </span>
<input value="10.1" class="validate[required,custom[integer]] text-input" type="text" name="integer2" id="integer2" />
</label>
</fieldset><input class="submit" type="submit" value="Validate &Send the form!" /><hr/>
</form>
</td>
</tr>
</tbody>
</table>
</body>
</html>
?>