File: index.html

Recommend this page to a friend!
  Classes of Peter Taiwo   validator   index.html   Download  
File: index.html
Role: Example script
Content type: text/plain
Description: Example
Class: validator
Validate form input values according to rules
Author: By
Last change:
Date: 7 years ago
Size: 1,016 bytes
 

Contents

Class file image Download
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <form class="form" name="form"> <input type="text" class="name" name=""> <span class="validator-error-span"></span> <input type="password" class="password" name=""> <span class="validator-error-span"></span> <input type="text" class="email" name=""> <span class="validator-error-span"></span> <input type="submit" value="Send" name=""> </form> <script type="text/javascript" src="../jquery/jquery.js"></script> <script type="text/javascript" src="validator.js"></script> <script type="text/javascript"> var validator = new Validator('form').configure( [ { required: true, input: '.name', errorType: 'default', minLength: 5, match: new RegExp(/^[a-z]/) }, { input: '.password', required: true, errorType: 'default' }, { input: '.email', required: true, errorType: 'default' } ], ).onFormSubmit(function(form) { validator.log(form); }).validate(); </script> </body> </html>