This article describes how to submit the validate and form plug-ins in jquery. For more information, see the following section: This article mainly discusses jquery. combine validate with jquery. form to verify and submit the form.
Method 1: Use the submitHandler option of jquery. validate to execute the callback function when the form passes verification. In this callback function, the form is submitted through jquery. form;
Method 2: Use beforeSubmit of jquery. form, that is, the callback function executed before the form is submitted. If this function returns true, the form is submitted. If false is returned, the form is terminated. Based on the valid () method of the jquery. validate plug-in, you can use jquery. form to verify the form when submitting a form.
Method 3: Use jquery. validate to verify the form's validate method. The advantage of this method is that it controls form verification more freely.
Example: The following three examples are used to describe the above three methods.
Load a CSS style File
The Code is as follows:
CSS style File Content
input{ height:25px; line-height:25px; padding-left:4px;}span.checked{ padding: 0px 5px 0px 25px; margin-left: 10px; margin-top: 0px; margin-bottom: 3px; height: 25px; line-height:25px; font-size: 12px; white-space: nowrap; text-align: left; color: #E6594E; background: url("images/acion2.png") no-repeat 3px; /* #FCEAE8 */}span.unchecked{ padding: 0px 5px 0px 25px; margin-left: 10px; margin-top: 0px; margin-bottom: 3px; height: 23px; line-height:23px; font-size: 12px; border: 1px solid #E6594E; white-space: nowrap; text-align: left; color: #E6594E; background: #FCEAE8 url("images/acion.png") no-repeat 3px;}
Load javascript files