Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

alameenkhader/validate-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

29f3762 · Oct 6, 2014

History

11 Commits
Oct 6, 2014
Oct 6, 2014
Oct 6, 2014

Repository files navigation

validate-form

Validate Your Forms with ease

Validate forms Use the method validateForm(selector)

Class:

  • validate-required
  • validate-number
  • validate-email
  • validate-url
  • validate-date
  • validate-past-date # For dates such as birthdays, must be a past date. right?

example:
HTML:

  <form id="myForm">  
      <input type="text" class="validate-required"/>
      <input type="email" class="validate-required validate-email"/>
      <input type="text" class="validate-url"/>
      <input type="submit" value="Save" />
  </form>

Javascript:

     $(function(){  
         var selector = '#myForm';
         $(selector).submit(function(){  
             if(validateForm(selector)) {
                 return true;
             } else {  
                 // Ah! I think there are some errors in your input
                 return false; 
             }  
         });  
     });  

About

Validate Your Forms with ease

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published