Vinter.validate

Vinter.validate
 点击下载

A very simple to use form validation plugin for jQuery, no complicated settings and configuration options to get going.

Start using straight away

Error messages in markup

Easy plugin in existing forms, just add error messages and a call to the validator!

Per fieldset validation

Currently supporting:

Validate empty text fields

Email-validation

Number validation

Checkbox and radio-button groups validation

Select-box validation

If title="" attr is used and the input value == title the field will still be marked with error to allow for using default form values and "descriptions"

HTML in error messages

Custom validation callback

adds "notvalid" class to form fields

Super simple usage.

Choose to validate specific fieldsets only

Usage

  1. <div id="validationmsg"></div> 
  2. <fieldset> 
  3.     <label> 
  4.         Name: <input type="text" class="required" /> 
  5.         <span class="errmsg">This is the error message, hideme with css</span> 
  6.     </label> 
  7.     <input type="submit" value="Submit form" onclick="return jQuery.validate()" /> 
  8. </fieldset> 

The errmsg have to be inside the field label for the validator to find it. The validationmsg div can be anywhere on the page, and the ID can be configurated using the options. See demo page for more advanced example including checkbox & radiobutton validation.

 

 

转载请注明:代码家园 » Vinter.validate

评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)