jVal

jVal
 点击下载

Super-sexy animated form field validation plugin.

Very easy to apply field validation on a per field basis in the html <INPUT> declaration. Very user friendly in showing each field that has not passed validation. Easy support for restriction of characters in a field, i.e. phone number only allowing digits. Allows for associating the ENTER key with a specific function.

To use simply add a jKey="" or jKeyVal="" to the <INPUT> html tag you would like to have validation associated with such as this example to make sure that a field has 10 digits as well as only allowing digits to being entered (i.e. US Phone number input field):

  1. <INPUT ID="phoneNumber" TYPE="text" 
  2.     jVal="{valid:function (val) { if (val.length != 10) return false; else return true; }, message:'10 Digits for Phone Required', styleType:'cover'}" 
  3.     jValKey="{valid:/[0-9]/, message:'&quot;%c&quot; Invalid Character - Only Digits Allowed', cFunc:'$(\'#formContainer\').jVal()', styleType:'pod'}">  

The validation from jVal will render the flyout messaging in the "cover" style and the flyout messaging for invalid characters will be in the "pod" style - see for more info.

 

转载请注明:代码家园 » jVal

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