Easyui Create an asynchronous submit formThis article shows you how to submit a form by Easyui. We create a form with the name, email, and phone fields. Use the Easyui form plug-in to change the form (form) to an AJAX form (
This article is about PHP form validation corresponding to the Jquery-validate plug-in, has a certain reference value, now share to everyone, the need for friends can refer to
Direct code. If you do not understand the parameters, you can refer to the Jquery-validate plugin
Learning Recommendations:"THINKPHP5 Classic
Objective
This problem after my collation found that the knowledge of the event and JS structure did not understand clearly, return false in the onclick event did not return, so onclick after just showing the false value.
Workaround Example
is a common form validation submission:
checkUserInfo()is a jquery authentication method, error return false .
validation rule
age:{
Required: "Age cannot be empty",
Range: "Age must be between 26 and 50"
},
Edu: "Choose at least one degree",
birthday:{
Required: "Date of birth cannot be empty",
Dateiso: "Birth date format is incorrect"
},
email:{
$ ("#commentForm"). Validate (): On it, what parameters should be added ...
Registration information authentication text message $ (function () {JQuery.validator.addMethod ("IsMobile", function (value, Element) {var length = Val
Ue.length; return this.optional (Element) | | (length = /^ ((13[0-9]{1}) | ( 15[0-9]{1}) | (18[0-9]{1}))
+\D{8}) $/.test (value)); "Please fill in your phone number correctly."
"); Entry into force $ ("#signup-form
//Verify the information for the formvarMessage= "";functionValidate () {varLienceplate = document.getElementById ("Lienceplate");//License plate number varBar_code = document.getElementById ("Bar_code");//Vehicle Barcode varPhoneNumber = document.getElementById ("PhoneNumber");//Telephone varMobile =/^1[3458]\d{9}$/;//Phone number varLienceplatereg =/^[\u4e00-\u9fa5]{1}[a-z]{1}[a-za-z_0-9]{5}$/;//the regular of the car, the letter case can be varBar_codereg =/^[a-z]{2}[0-9]{8}$/;
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.