Ajax functions are mainly used in JS, Ajax does not require ASP, ASP is responsible for the background display and operation of the server data.
You can think like this:
1. Write form the first item (such as user name)
2.onblur event (lost focus) begins validation when it occurs, onblur= "Checkusername ()"
3.js send a
This article mainly introduced the Yii2 modal window ActiveForm Ajax form verification related data, very good with reference value, the need for friends can refer to. We hope to help you.
We will yii2 ActiveForm how to submit a form in an AJAX manner, which is the focus of our topic today.
YII2, ActiveForm does clien
We talked about how to use the modal in the Yii2 and how to use modal in Yii2 in the GridView list, and we thought modal would come to an ending to start a new topic, but the actual problem was often beyond imagination, This does not modal the window to submit the table to say how to verify the problem again came out, and came out!
First of all, regardless of modal, we will yii2 ActiveForm how to submit the form in an
r_eamil=/^\w+@\w+ (\.) \w+$/
Match a QQ email address
861745122@qq.comvar r_qq_email=/^\d{5,} @qq (\.) com$/
Match a 163 email address var r_163_email=/^\w+@163 (\.) com$/ Matching a suffix name may be. com|.net|.cn|.edu var email=/^\w+@\w+ (\.) com|net|cn|edu$/ Required to enter a valid age section var r_age=/^\d{1,2}$/ if (age>=18age "=100") Verify mobile phone Number: 11 digits 13 15 18 Start var r_tel=/^1[3,5,8]\d{9}$/ Verify ID number 18 digits or 17 digits plus an X var r_s=/^\d{18}|\d
The latest updates have been modified when the input component name is included []. The focus on the component will appear JS error, only IE is the case, did not find a good solution, I just to exclude this situation, that is, when the component name contains [] does not focus on moving up, Please contact me for any good solution.
and made a demo8--combining jquery to implement AJAX custom
Compatible: Opera 9.6 + Chrome 2.0 + FF 3 + IE 6 effect: Verify while entering one side Image Environment: Ruby 1.8.6 + rails 2.1.0 + Windows Core code: HTML: browser disables JavaScript when displaying a message: copy code code as follows: when the browser disables JS, the Submit button is not available to implement client-side validation! copy code code as follows: $ ("Js_support"). Style.display = "block"; Listening for
The validation that is involved in this example is:
User name: Length, character verification, repetitive Ajax validation (whether it already exists).
Password: Length verification, repeat input password verification.
Mail: Email address verification.
Fixed Telephone: Fixed telephone number verification in mainland China.
Mobile phone Number: China mainland
is real-time data validation.
This article focuses on using AJAX to enhance the existing struts validation framework. Several components, such as a controller, must be developed to select a validation framework and to render messages in a particular format (for clients) and tag libraries (handling error message render
Directory (?) [-] Options parameter Description Optional Use method load CSS file load JavaScript file add ID to form plus ID to control and set validation type set validation validation type API method validationengine Chinese version jquery Powerful form verification plug-
Article Introduction: easy to use jquery form verification plug-in--jquery.validate.js.
Jquery.validate.js is a validation plug-in for jquery, and with the advantage of jquery, we can quickly validate some of the common inputs and expand our own authentication methods. Please download the necessary jquery plugins before using: Jquery-1.4.2.min.js and Jquery.validate.min.js.
The following shows
Validate files in the header.
After the file is introduced, write a simple form.
Then we begin to write the verification form code.
First, we need to know that the form needs to be verified.
$(function(){ $('#commentForm').validate(); });
Then write the validation rules. Note that the selection element is selecte
: Verification Code AJAX authentication.How to use:1. Prepare jquery and Jquery.validate plugins "text/javascript" src="js/ Jquery.validate.js"2. Prepare CSS StylePage style I no longer detail, you can write a style, you can also see the demo page source code. The key style to emphasize here is to display the style of the validation information:Label.error{color: #ea5200; margin-left:4px; padding:0px 20px
code of the Verification formFirst we need to know that the form needs to be verified.1 $ (function () {2 3 $ (' #commentForm '). Validate (); 4 5 });Then start writing validation rules, note that the selection element here is based on the Name property of each tag, and the basic syntax is as follows1 $ (' #commentForm '). Validate ({2 rules: {3
verification.Verification Code: Verification Code AJAX verification.How to use:1. Prepare jquery and Jquery.validate Plug-ins
2. Prepare CSS Stylepage style I no longer elaborate, you can write a style, you can also see the demo page source code. The key style to emphasize here is the style to display the validation information:
Label.error{color: #ea5200; margin-left:4px; padding
code of the Verification formFirst we need to know that the form needs to be verified.1 $ (function () {2 3 $ (' #commentForm '). Validate (); 4 5 });Then start writing validation rules, note that the selection element here is based on the Name property of each tag, and the basic syntax is as follows1 $ (' #commentForm '). Validate ({2 rules: {3
();//$ ( form). Ajax.submit ();//$ajax Submit Form}invalidhandler:function (Event,validator) {//event: Invalid validation triggered event//validator: Object } You can also write an event to trigger $ ("Selector property value"). On ("event name", function (Event,validator)) {}); ignore: "#hh" does not validate class H
JQuery form plugin jquery. form. js and jquery form validation plugin
Overview
JQuery Form Plugin allows you to easily upgrade forms submitted in HTML Form to forms submitted using AJAX
Http://www.cnblogs.com/shuang121/archive/2012/04/23/2466628.htmlRoleJquery.validate is a validation framework for jquery, and with the advantage of jquery, we can quickly validate some of the common inputs and expand our own validation methods and support internationalization as well.Pre-use arrangementDescription: Requires jquery version: 1.2.6+Steps:To import the appropriate jquery.js and jquery.validate.
: Alidator.form ()//Verify that the form is valid and return True/falseAlidator.element (Element)//verifies that an element is valid, returns True/falseAlidator.resetform ()//restore the form to its original state before verificationAlidator.showerrors (Errors)//a specific error message is being displayed for an elementAlidator.numberofinvalids ()//returns the number of invalid elementsValidator Object stat
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.