JQuery Validation Engine Form Validation

Source: Internet
Author: User
Tags dateformat jquery form validation
<span id="Label3"></p><p><p>A powerful jQuery form validation plugin for everyday e-mail, phone numbers, urls, and other validation and Ajax validation, in addition to its own rich validation rules, you can add custom validation rules.</p></p><p><p>Compatible with IE 6+, Chrome, Firefox, Safari, Opera</p></p> <dl> <dl> <dt> Some differences from version 2.2.4: </dt> </dl> </dl><p><p></p></p> <dl> <dl> <dt></dt> the <dd> function of some parameters is changed; </dd> the <dd> input control can not write the ID attribute; </dd> <dd> the parameters onsuccess and onfailure are changed to only trigger when the form is submitted; </dd> <dd> validation rules past[date] (past) and future[date] (future) swapped; </dd> <dd> API Interface validation control uses "validate" to remove "validatefield"; </dd> the <dd> API interface Hide prompt uses "hide" to remove "hideprompt" and leave "hideall". </dd> </dl> </dl> <dl> <dl> <dt> Ciaoca Chinese optimized version: </dt> <dd> Refine styles based on Chinese fonts </dd> <dd> add multiple validation styles </dd> <dd> Add validation rules for Chinese </dd> <dd> example of removing useless validation rules </dd> <dd> improved support for IE8 browsers (error: object does not support "indexOf" property or METHOD) </dd> </dl> </dl>Version: jQuery v1.7+jquery Validation Engine v2.6.2 <ul class="release"> <ul class="release"> <li>View Demo</li> <li>Download JQuery Validation Engine v2.6.2</li> <li>Chinese optimized version: jQuery Validation Engine v2.6.2 by Ciaoca</li> <li>Submit a Question/Bug/suggestion</li> </ul> </ul>Document Directory <ol class="list"> <ol class="list"> <li>How to use</li> <li>validation type</li> <li>Parameter description</li> <li>HTML5 Property</li> <li class="n">API interface</li> <li>Custom events</li> <li>Related information</li> </ol> </ol>Loading CSS files using methods<pre><pre><code class="html hljs xml"><span class="hljs-tag"><<span class="hljs-name">link <span class="hljs-attr">rel=<span class="hljs-string">"stylesheet" <span class="hljs-attr">href=<span class="hljs-string">"css/validationEngine.jquery.css"></span></span></span></span></span></span></code></pre></pre>Loading JavaScript files<pre><pre> <code class="html hljs xml"><span class="hljs-tag"><<span class="hljs-name">script <span class="hljs-attr">src=<span class="hljs-string"> "js/jquery.js" ><span class="undefined"> <span class="hljs-tag"></<span class="hljs-name">script><span class="hljs-tag">< <span class="hljs-name">script <span class="hljs-attr">src=<span class="hljs-string"> js/ Jquery.validationengine-zh_cn.js "><span class=" undefined "><span class=" hljs-tag "></ <span class="hljs-name">script><span class="hljs-tag"><<span class="hljs-name">script <span class="hljs-attr">src=<span class="hljs-string"> "js/jquery.validationengine.js" > <span class="undefined"><span class="hljs-tag"></<span class="hljs-name">script> <span class="hljs-comment"><!--jquery.validationengine-zh_cn.js as profile, can be adjusted or added on demand, or can be changed to other language profiles-- </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span> </span></span></span></span></span></span></code></pre></pre>Add ID to form<pre><pre><code class="html hljs xml"><span class="hljs-comment"><!-- ID 须设置在 form 标签中 --><span class="hljs-tag"><<span class="hljs-name">form <span class="hljs-attr">id=<span class="hljs-string">"form_id" <span class="hljs-attr">...>...<span class="hljs-tag"></<span class="hljs-name">form></span></span></span></span></span></span></span></span></code></pre></pre>To add a validation type to a control<pre><code class="html hljs xml"><span class="hljs-comment"><!--validation rules By default use the class attribute validate[required] to indicate that the item must be filled-<span class="hljs-tag"><span class="hljs-tag"><<span class="hljs-name">input <span class="hljs-attr">type=<span class="hljs-string">"text" <span class="hljs-attr">class=<span class="hljs-string">"validate[required" "><span class="hljs-tag"><<span class="hljs-name">input <span class="hljs-attr">type=<span class="hljs-string">" CheckBox " <span class="hljs-attr">class=<span class="hljs-string">" validate[required] "><span class="hljs-tag"><<span class="hljs-name">select <span class="hljs-attr">class=<span class="hljs-string">" validate[required] "> <span class="hljs-tag"></<span class="hljs-name">select>; <span class="hljs-tag"> <<span class="hljs-name">textarea <span class="hljs-attr">class=<span class="hljs-string">"validate[required" ><span class="hljs-tag"></<span class="hljs-name">textarea></span> </span> </span> </span> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code></pre>Set up validation<pre><pre><code class="js hljs javascript"><span class="hljs-comment">// 直接调用$(<span class="hljs-string">‘#form_id‘).validationEngine();<span class="hljs-comment">// 自定义参数调用$(<span class="hljs-string">‘#form_id‘).validationEngine(<span class="hljs-string">‘attach‘, { promptPosition: <span class="hljs-string">‘centerRight‘, scroll: <span class="hljs-literal">false});</span></span></span></span></span></span></span></code></pre></pre>Support chain operation<pre><pre><code class="js hljs javascript">$(<span class="hljs-string">‘#form_id‘).validationEngine().css({border:<span class="hljs-string">‘2px solid #000‘});</span></span></code></pre></pre>validation type<p><p>Note: the validation rules are written in validate[], if there are multiple rules, separated by commas (,).</p></p><p><p>Cases:<code>validate[required,minSize[6],custom[onlyLetterNumber]]</code></p></p> <table class="manual_table"> <thead> <tr> <th width="200">name</th> <th>Example</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Required</td> <td>validate[required]</td> <td>Denotes required fields</td> </tr> <tr> <td>grouprequired[string]</td> <td>validate[grouprequired[grp]]</td> <td>Enter or select at least one of the groups in which the validation group is GRP</td> </tr> <tr> <td>condrequired[string]</td> <td>validate[condrequired[ids]]</td> <td>When a control of IDs is not empty, the control is also required.<p>Can rely on multiple items, such as: validate[condrequired[id1,id2]][demo]</p></td> </tr> <tr> <td>minsize[int]</td> <td>validate[minsize[6]]</td> <td>Minimum number of characters to enter</td> </tr> <tr> <td>maxsize[int]</td> <td>validate[maxsize[20]]</td> <td>Maximum number of characters entered</td> </tr> <tr> <td>min[int]</td> <td>validate[min[1]]</td> <td>Minimum value (the item is the minimum value of the number, note the distinction from MinSize)</td> </tr> <tr> <td>max[int]</td> <td>validate[max[9999]]</td> <td>Maximum value (the item is the maximum value of the number, note the distinction from MaxSize)</td> </tr> <tr> <td>mincheckbox[int]</td> <td>validate[mincheckbox[2]]</td> <td>Minimum number of items selected (for Checkbox)</td> </tr> <tr> <td>maxcheckbox[int]</td> <td>validate[maxcheckbox[2]]</td> <td>Maximum number of items selected (for Checkbox)</td> </tr> <tr> <td>date[string]</td> <td>validate[custom[date]]</td> <td>Validation date in the format yyyy/mm/dd, yyyy/m/d, yyyy-mm-dd, yyyy-m-d</td> </tr> <tr> <td>dateformat[string]</td> <td>validate[custom[dateformat]]</td> <td>Verify date format in yyyy/mm/dd, yyyy/m/d, yyyy-mm-dd, yyyy-m-d</td> </tr> <tr> <td>datetimeformat[string]</td> <td>validate[custom[datetimeformat]]</td> <td>Verify the date and time format in the format: yyyy/mm/dd hh:mm:ss am| Pm</td> </tr> <tr> <td>daterange[string]</td> <td>validate[daterange[grp1]]</td> <td>Verify that the value of GRP1 matches the date range (start date and end Date)<p>Depending on the front and back position of the control, if the current control is after the GRP1 element, the date entered cannot be the past of the GRP1 Date.</p><p>If the current control is before the GRP1 control, the date entered cannot be the future of the GRP1 Date. [Demo]</p></td> </tr> <tr> <td>datetimerange[string]</td> <td>validate[datetimerange[grp1]]</td> <td>Verify date and time range, increase time contrast, others as Daterange.</td> </tr> <tr> <td>past[string]</td> <td>validate[past[2012/12/20]]</td> <td>Date must be the past of date or Date. Date format can be written yyyy/mm/dd, yyyy/m/d, yyyy-mm-dd, yyyy-m-d, or Now</td> </tr> <tr> <td>future[string]</td> <td>validate[future[now]]</td> <td>The date must be the future of data or Date. Date format can be written yyyy/mm/dd, yyyy/m/d, yyyy-mm-dd, yyyy-m-d, or Now</td> </tr> <tr> <td>equals[string]</td> <td>validate[equals[id]]</td> <td>The value of the current control needs to be the same as the value of the control ID</td> </tr> <tr> <td>Number</td> <td>validate[custom[number]]</td> <td>Verifying numbers</td> </tr> <tr> <td>Integer</td> <td>validate[custom[integer]]</td> <td>validating integers</td> </tr> <tr> <td>Phone</td> <td>validate[custom[phone]]</td> <td>Verify phone number</td> </tr> <tr> <td>Email</td> <td>validate[custom[email]]</td> <td>Verify e-mail address</td> </tr> <tr> <td>Url</td> <td>validate[custom[url]]</td> <td>To verify the URL address, start with http, https://, or ftp://</td> </tr> <tr> <td>IPv4</td> <td>validate[custom[ipv4]]</td> <td>Verify IPv4 Address</td> </tr> <tr> <td>Onlynumbersp</td> <td>validate[custom[onlynumbersp]]</td> <td>Only fill numbers and spaces are accepted</td> </tr> <tr> <td>Onlylettersp</td> <td>validate[custom[onlylettersp]]</td> <td>Only English letters, single quotation marks (') and spaces are accepted</td> </tr> <tr> <td>Onlyletternumber</td> <td>validate[custom[onlyletternumber]]</td> <td>Only numbers and letters of English are accepted</td> </tr> <tr> <td>Custom[custom rules]</td> <td>validate[custom[rulename]]</td> <td>Custom Rule Validation<pre><code class="js hljs javascript"><span class="hljs-string">‘ruleName‘: { <span class="hljs-string">‘regex‘: <span class="hljs-built_in">RegExp, <span class="hljs-comment">/* 正则表达式,如果正则能匹配内容表示通过 */ <span class="hljs-string">‘alertText‘: <span class="hljs-string">‘验证不通过时的提示信息‘}</span></span></span></span></span></span></code></pre></td> </tr> <tr> <td>Ajax</td> <td>validate[ajax[ajaxname]]</td> <td>customizing AJAX validation<pre><pre><code class="js hljs javascript"><span class="hljs-string">‘ajaxName‘: { <span class="hljs-string">‘url‘: <span class="hljs-string">‘phpajax/ajaxValidateFieldUser.php‘, <span class="hljs-comment">/* 验证程序地址 */ <span class="hljs-string">‘extraData‘: <span class="hljs-string">‘name=eric‘, <span class="hljs-comment">/* 额外参数 */ <span class="hljs-string">‘alertTextOk‘: <span class="hljs-string">‘验证通过时的提示信息‘, <span class="hljs-string">‘alertText‘: <span class="hljs-string">‘验证不通过时的提示信息‘, <span class="hljs-string">‘alertTextLoad‘: <span class="hljs-string">‘正在验证时的提示信息‘}<span class="hljs-comment">/* * 例: * <input type="text" id="email" class="validate[ajax[ajaxName]]"> * 假设填写的值为:[email protected] * extraData 设置为:‘type=register&verify=abcd‘ * 提交到后端的 url 为:phpajax/[email protected]&type=register&verify=abcd */</span></span></span></span></span></span></span></span></span></span></span></span></span></span></code></pre></pre><p><p>Transfer mode: get</p></p><p><p>Pass Parameters: "fieldid=" + field.attr ("id") + "&fieldvalue=" + field.val ()</p></p><p><p>Extra Parameter: Extradata can be set to a string or object, append "&extradata" to the end of the argument</p></p><p><p>Return Data format: JSON</p></p><p><p>Return Data content: [string,boolean]</p></p><p><p>The first value type is String, which is the value that receives the fieldid;</p></p><p><p>The second value type is Boolean, which is verified by returning true, not by returning false</p></p><p><p>For details, please refer to [Demo]</p></p></td> </tr> <tr> <td>Funccall</td> <td>validate[funccall[functionname]]</td> <td>Calling external function validation<p>functionname (field, rules, i, Options)</p></td> </tr> </tbody> </table>Ciaoca Enhanced Validation Rules: <table class="manual_table"> <thead> <tr> <th width="200">name</th> <th>Example</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Chinese</td> <td>validate[custom[chinese]]</td> <td>Accept Chinese Characters only</td> </tr> <tr> <td>Chinaid</td> <td>validate[custom[chinaid]]</td> <td>Verify the ID number (only 18-digit ID number is Supported)</td> </tr> <tr> <td>Chinaidloose</td> <td>validate[custom[chinaidloose]]</td> <td>Verify the ID number (support 15 and 18-digit ID number)</td> </tr> <tr> <td>Chinazip</td> <td>validate[custom[chinazip]]</td> <td>Verify postal code</td> </tr> <tr> <td>Qq</td> <td>validate[custom[qq]]</td> <td>Verify QQ number</td> </tr> </tbody> </table>Parameter description <table class="manual_table"> <thead> <tr> <th width="200">name</th> <th width="120">Default Value</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Validationeventtrigger</td> <td>' Blur '</td> <td>Events that trigger validation and support events can refer to the event description of JQuery.<p>PS: If you want to validate only when the form is submitted, you can set it to Null. or set the parameter Binded:false</p></td> </tr> <tr> <td>binded</td> <td>True</td> <td>Whether to bind instant authentication</td> </tr> <tr> <td>Scroll</td> <td>True</td> <td>The screen automatically scrolls to the location where the first validation does not pass.</td> </tr> <tr> <td>Focusfirstfield</td> <td>True</td> <td>If validation fails, the first control that does not pass gets the Focus.</td> </tr> <tr> <td>Validatenonvisiblefields</td> <td>False</td> <td>Whether to validate elements that are not visible (such as the input box for type= "hidden", or multiple input controls in a tab switch)</td> </tr> <tr> <td>Showprompts</td> <td>True</td> <td>Whether to display the prompt message</td> </tr> <tr class="unknown"> <td>Showarrow</td> <td>True</td> <td>Whether to display the arrows for the message</td> </tr> <tr> <td>Promptposition</td> <td>' TopRight '</td> <td><p>The location of the cue information can be set to: ' TopRight ', ' topleft ', ' bottomright ', ' bottomleft ', ' centerright ', ' centerleft ', ' inline '</p><p>You can set a more specific position in the format: "direction: x offset, y offset." Such as:<code>bottomLeft: -20, 5</code></p></td> </tr> <tr> <td>Autopositionupdate</td> <td>False</td> <td>Whether to automatically adjust the position of the cue layer</td> </tr> <tr> <td>Autohideprompt</td> <td>False</td> <td>Whether to automatically hide the hint message</td> </tr> <tr> <td>Autohidedelay</td> <td>100000</td> <td>Delay time (ms) for auto-hide cue information</td> </tr> <tr> <td>Fadeduration</td> <td>0.3</td> <td>Hide message Fade out time</td> </tr> <tr> <td>Addpromptclass</td> <td>‘‘</td> <td>Add class to Cue message<p>In the Ciaoca enhanced version, add the following styles:</p><p>' Formerror-noarrow '--no arrowhead Style</p><p>' Formerror-text '--plain Text style</p><p>' Formerror-small '--lite Style</p><p>' Formerror-white '--white version style</p><p>Can be used overlay, such as:<code>addPromptClass: ‘formError-noArrow formError-small‘</code></p></td> </tr> <tr> <td>Custom_error_messages</td> <td>{}</td> <td>Custom error message Content [Demo]</td> </tr> <tr> <td>Maxerrorsperfield</td> <td>False</td> <td>A single element displays the maximum number of error prompts, and the value is set to numeric Values. The default false means no Limit.</td> </tr> <tr> <td>Showonemessage</td> <td>False</td> <td>Whether to display only one prompt message</td> </tr> <tr> <td>Donotshowallerrosonsubmit</td> <td>False</td> <td>Do not display all error messages when submitting a form (recommended use of parameter Showonemessage overrides)</td> </tr> <tr> <td>Addsuccesscssclasstofield</td> <td>‘‘</td> <td>When validation passes, add class to the control, which is removed when the validation fails Again.</td> </tr> <tr> <td>Addfailurecssclasstofield</td> <td>‘‘</td> <td>When validation fails, add class to the control, which is removed when the validation passes Again.</td> </tr> <tr> <td>Prettyselect</td> <td>False</td> <td>Whether to use a beautified Select selection control [Demo]</td> </tr> <tr> <td>Onfieldsuccess</td> <td>False</td> <td>callback function when control validation passes<p>function (field) {}</p></td> </tr> <tr> <td>Onfieldfailure</td> <td>False</td> <td>callback function when control validation fails<p>function (field) {}</p></td> </tr> <tr> <td>Onsuccess</td> <td>False</td> <td>callback function when the form verifies that the result is passed</td> </tr> <tr> <td>OnFailure</td> <td>False</td> <td>callback function when the form verifies that the result is unsuccessful<p>Ps:onsuccess and OnFailure please refer to [Demo]</p></td> </tr> <tr> <td>Onvalidationcomplete</td> <td>False</td> <td>callback function when form submission validation is complete [Demo]<p>function (form, Valid) {}, parameters:</p><p>Form: form Elements</p><p>Valid: validation result (ture or False)</p><p>PS: when this method is used, the form is not committed, even if it is validated, and is passed to the defined callback Function.</p></td> </tr> <tr> <td>Ajaxformvalidation</td> <td>False</td> <td>Whether to submit the form using Ajax (by default, send data by using GET Mode)</td> </tr> <tr> <td>Ajaxformvalidationurl</td> <td>False</td> <td>Set the URL for the Ajax submission by default using the Form's Action property</td> </tr> <tr> <td>Ajaxformvalidationmethod</td> <td>' Get '</td> <td>How to send data when you set up an Ajax submission</td> </tr> <tr> <td>Onajaxformcomplete</td> <td>$.noop</td> <td>Form submission, Ajax validation completed behavior (Function) [Demo]<p>function (status, form, json, OPTIONS) {}</p></td> </tr> <tr> <td>Onbeforeajaxformvalidation</td> <td>$.noop</td> <td>After the form is submitted for validation, the callback function before the Ajax submission [Demo]<p>function (form, Options) {}</p></td> </tr> <tr> <td>Ajaxvalidcache</td> <td>{}</td> <td></td> </tr> <tr> <td>IsError</td> <td>False</td> <td></td> </tr> <tr> <td>Invalidfields</td> <td>[]</td> <td></td> </tr> <tr> <td>Isoverflown</td> <td>False</td> <td>Whether the form is within the element that overflows the scroll (that is, the external element is set to Overflow:scroll)<p>PS: when set to ture, the insertion position of the hint content will be changed to insert before the validated control;</p><p>At this point, you need to set a second element in the outer layer of the control, and class= "inputcontainer"</p></td> </tr> <tr> <td>Overflowndiv</td> <td>‘‘</td> <td>Set the overflow scrolling element in the format jQuery Selector.</td> </tr> <tr> <td>Useprefix</td> <td>‘‘</td> <td>Using ID prefixes</td> </tr> <tr> <td>Usesuffix</td> <td>‘‘</td> <td>Using the ID suffix</td> </tr> <tr class="unknown"> <td>ValidateAttribute</td> <td>' Class '</td> <td>Properties that hold validation rules</td> </tr> <tr class="unknown"> <td>Bindmethod</td> <td>' Bind '</td> <td></td> </tr> <tr class="unknown"> <td>Inlineajax</td> <td>False</td> <td></td> </tr> </tbody> </table>HTML5 Property <table class="manual_table"> <thead> <tr> <th width="280">Property name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Data-validation-engine</td> <td><p>Set up validation rules</p><p>In addition to using class to set validation rules, you can also use this property to set validation Rules.</p></td> </tr> <tr> <td>Data-validation-placeholder</td> <td><p>Placeholder</p><p>When the location is required for a control to be validated, the value cannot be empty and cannot be a placeholder.</p></td> </tr> <tr> <td>Data-prompt-position</td> <td><p>The location of the custom cue information can be set to: "topright", "topleft", "bottomright" "bottomleft", "centerright", "centerleft", "inline"</p><p>You can set a more specific position in the format: "direction: x offset, y offset." Such as: data-prompt-position= "bottomleft:20,5"</p><p>PS: The offset value can be negative</p></td> </tr> <tr> <td>Data-prompt-target</td> <td><p>The container that loads the cue information, the value of the Element's ID</p><p>Only if Promptposition or data-prompt-position is set to "inline" is Valid.</p><p></p></td> </tr> </tbody> </table>Error message Properties (experimental)<p><p>property values correspond to validation rules</p></p><pre><pre><code class="html hljs xml"><span class="hljs-comment"><!-- 自定义错误信息属性(实验支持) --><span class="hljs-tag"><<span class="hljs-name">input <span class="hljs-attr">type=<span class="hljs-string">"email" <span class="hljs-attr">name=<span class="hljs-string">"email" <span class="hljs-attr">id=<span class="hljs-string">"email" <span class="hljs-attr">data-validation-engine=<span class="hljs-string">"validate[required,custom[email]]" <span class="hljs-attr">data-errormessage-value-missing=<span class="hljs-string">"E-mail 不能为空" <span class="hljs-attr">data-errormessage-custom-error=<span class="hljs-string">"E-mail 格式应为:[email protected]" <span class="hljs-attr">data-errormessage=<span class="hljs-string">"通用的错误提示信息"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></code></pre></pre> <table class="manual_table"> <thead> <tr> <th width="280">Property name</th> <th>corresponding validation rules</th> </tr> </thead> <tbody> <tr> <td> data-errormessage-value-missing </td> <td> <ul> <li> required </li> <li> grouprequired </li> <li> condrequired </li> </ul> </td> </tr> <tr> <td> data-errormessage-type-mismatch </td> <td> <ul> <li> past </li> <li> future </li> <li> Datera Nge </li> <li> datetimerange </li> </ul> </td> </tr> <tr> <td> data-errormessage-pattern-mismatch </td> <td> <ul> <li> creditCard </li> <li> equals </li> </ul> </td> </tr> <tr> <td> data-errormessage-range-underflow </td> </tr> <t d> <ul> <li> minSize </li> <li> min </li> <li> mincheckbox </li> </ul> </t> <tr> <td> Data-errormessa Ge-range-overflow </td> <td> <ul> <li> maxSize </li> <li> max </li> <li> maxcheckbox </li> </ul> </td> </tr> <tr> <td> data-errormessage-custom-error </td> <td> <ul> <li> custom </li> <li> ajax </li> <li> Funccall </li> </ul> </td> </tr> <tr> <td> data-errormessage </td> <td> common error message </td> </tr> </tbody> </table>API interface <table class="manual_table"> <thead> <tr> <th width="200">name</th> <th>Example</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Attach</td> <td>$ (' #form_id '). validationengine (' Attach ');</td> <td>Binding form Validation</td> </tr> <tr> <td>Detach</td> <td>$ (' #form_id '). validationengine (' Detach ');</td> <td>Remove form Validation</td> </tr> <tr> <td>Validate</td> <td>Alert ($ (' #id '). validationengine (' Validate '));</td> <td>Validates the control or form, returns a result of true or false</td> </tr> <tr> <td>Showprompt</td> <td>$ (' #id '). validationengine (' showprompt ', ' hint content ', ' load ');</td> <td>Create a hint on this element, 3 states: ' pass ', ' error ', ' load '</td> </tr> <tr> <td>Hide</td> <td>$ (' #id '). validationengine (' Hide ');</td> <td>Hide changes to elements and hints within elements</td> </tr> <tr> <td>Hideall</td> <td>$ (' #id '). validationengine (' hideall ');</td> <td>Hide all hints on a page</td> </tr> <tr> <td>Updatepromptsposition</td> <td>$ (' #form_id '). validationengine (' updatepromptsposition ')</td> <td>Update the location of the cue layer</td> </tr> </tbody> </table>Custom events<p><p>Plugin added custom event, can refer to [Demo]</p></p> <table class="manual_table"> <thead> <tr> <th width="200">name</th> <th>Example</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Jqv.form.validating</td> <td>$ (' #form_id '). bind (' jqv.form.validating ', function (event) {});</td> <td>When the form is validated</td> </tr> <tr> <td>Jqv.form.result</td> <td>$ (' #form_id '). bind (' jqv.form.result ', function (event, errorfound) {});</td> <td>Form validation is Complete. Return parameter description:<p></p><p>Errorfound: form validation does not pass (true or False)</p><p></p></td> </tr> <tr> <td>Jqv.field.result</td> <td>$ (' #field_id '). bind (' jqv.field.result ', function (event, field, isError, Prompttext) {});</td> <td>A single control validation is Complete. Return parameter description:<p></p><p>Field: Control Object</p><p>IsError: control validation does not pass (true or False)</p><p>Prompttext: Tip Information</p></td> </tr> </tbody> </table>Related information <dl> <dl> <dt> Author's website: </dt> <dd> http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ </dd> </dl> </dl> <dl> <dl> <dt> Related Documents: </dt> <dd> Github </dd> <dd> Chinese documents </dd> </dl> </dl> <dl> <dl> <dt> License Agreement: </dt> <dd> MIT </dd> </dl> </dl><p><p></p></p><p><p>JQuery Validation Engine Form Validation</p></p></span>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.