Skip to content

A jquery plugin for validate.js form validation library

Notifications You must be signed in to change notification settings

ciberch/validate_helper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

validate_helper

validate_helper.js is a jquery plugin that helps you use validate.jsm to validate forms, without the need for creating the validation object. Rather you simply add few attributes to the form elements as stated below.

Form attributes to be added

  • Add name,id for the form tag.
 <form name="loginForm" id= "loginForm">
  • Add class "validate" for the form elements you want to validate.
 <input type="email" name="email" id="email" class="validate">
  • Add data-rules to specify the rules in validate.js
 <input type="email" name="email" id="email" class="validate" data-rules="required|valid_email">
  • Add data-display to specify the display attribute in validate.js (optional)
 <input type="email" <input type="email" name="email" id="email" class="validate" 
 data-rules="required|valid_email">data-display="Email address">
  • Call the validate() function by including the following lines inside a script tag before closing the body tag. Additionally you can specify the callback fuuntion to be handled(optional) after form validation is successful
var $my_form =  $("#loginForm")
$my_form.validate( self, self.onloginFormSubmit )

Contact Email: mahilis@live.com

About

A jquery plugin for validate.js form validation library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%