jquery's Serialize () method creates a URL-encoded text string by serializing the form value, we can select one or more form elements, or you can directly select the form to serialize it$ (document). Ready (function () { Console.log ($ ("form"). Serialize ());//firstname=billlastname=gates});$.ajax ({ type: ' Pos
jquery's Serialize () method creates a URL-encoded text string by serializing the form value, we can select one or more form elements, or you can directly select the form to serialize it, such as:FormAction="">First Name:InputType= "text" Name= " FirstName " Value=" Bill. />br />input = "text" Name= " LastName " Value/>br />
-wh_50 "/>Anyway, I'm using chrome, direct F12, see network Options, click Query. The page sees the return password,650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/82/06/wKiom1dH4-mCwcVeAADRpeq22DQ122.jpg-wh_500x0-wm_3 -wmp_4-s_1292154927.jpg "style=" Float:none; "title=" 3.jpg "alt=" Wkiom1dh4-mcwcveaadrpeq22dq122.jpg-wh_50 "/>What is the back end? Post the stuff.650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/82/06/wKiom1dH513h
Do file upload, you need to set the form elements of the enctype to ' Multipart/form-data ', using jquery attr method in the current more mainstream browser test can be successful, but ie under the dead and alive. Later, looking at IE browser 6,7,8 (9+ because the developer for XP, did not test) does not support the at
Serialization of Chinese is garbled because. Serialize () called the Encodeurlcomponent method to encode the dataThe workaround is to decodeCause:. Serialize () automatically calls the encodeURIComponent method to encode the dataWorkaround: Call decodeURIComponent (xxx,true); decode the dataProduct labelfunction tag (URL) { var form = $ (' form '). Serialize (); Serialization of content var Shuju = d
submission and submit submission
Note:when a Get method submits a form, the action cannot use a URL to pass the value, and the post can pass
The difference between JS submission and submit button submission:
1. JS submits the form without the value of the Submit button (because it is not clicked) all browsers
2. Input carriage return submission The Web browser will bring the value of the S
using jquery Ajax to implement the two-level linkage of a select form under Django
Implemented using Django+jquery:
On the internet also see many examples, comprehensive many examples, after trying to achieve a simple provincial and municipal two-level linkage, write down,
Use JQuery to submit the form without refreshing the following code
JQuery Official website http://jquery.com/ Examples: example:request the test.php page, but ignore the return results.
$.post ("test.php");
example:request the test.php page and send some additional data along (while still ignoring the return results).
$.post ("test.php", {name: "Jo
Basic Ideas:Get the jquery object of the corresponding form by using the jquery selector, and then use the attr method to modify the corresponding actionExample 1:The table form will be submitted to page_one.html.After clicking "button", the table ticket address is changed t
$ ("#login_btn"). Click (function () {Type is the button under Submit if ($ ("#id_password"). Val (). length = = 0) {// Verify that password is empty $ (' form '). Submit (function () { alert ("1") return false; }); else if ($ ("#vali"). val ()! = code) {//Verify that the code is correct $ (' form '). Submit (function () { alert ("2") return false; });
Demo shows everything:1 //This is the ID of the form2$ ("#idForm"). Submit (function() {3 4 varurl = "path/to/your/script.php";//The script where you handle the form input.5 6 $.ajax ({7Type: "POST",8 Url:url,9Data: $ ("#idForm"). Serialize (),//serializes the form ' s elements.TenSuccessfunction(data) One { Aalert (data);//Show response from the PHP script. - } - }); the
In jquery, Ajax defaults to asynchronous behavior (the default setting for Async is true,) so when Ajax is successful, onsubmit is actually executed, so return false is not able to prevent OnSubmit's default behavior.To solve the first to get Ajax asynchronous kill is to set the Async:false on the outside of Ajax set up a variable such as falg=true; write the IF (!) behind Ajax. FALG) {Reyurn false}This can solve the Ajax inside Retyrn flase Invalid b
The submitHandler commit of the jQuery validate plug-in leads to an endless loop solution. jqueryvalidate is submitted.
This article describes the solution to the endless loop caused by submitHandler submission of the jQuery validate plug-in. We will share this with you for your reference. The details are as follows:
T
with at least {0} length ), Rangelength: jQuery. validator. format (enter a string between {0} and {1 ), Range: jQuery. validator. format (enter a value between {0} and {1 ), Max: jQuery. validator. format (enter the maximum value of {0 ), Min: jQuery. validator. format (enter a minimum value of {0)});
We recommend th
There are a lot of ways to serialize a form to an object, and in this article I'll show you how to do it using jquery, and interested friends can refer to the followingThe code is as follows: Var aa=function (form) {var o={}; $.each (Form.serializearray (), function (index) {if (o[this[' name ']]) {o[this[' name ']] =
The example in this article describes how jquery submits a form using $.ajax. Share to everyone for your reference, specific as follows:
First, create a new login.html page:
Then, create a new login.aspx to receive and process the data:
I hope this article will help you with the jquery program d
See http://docs.jquery.com/plugins/validationand sort out
Jquery. validate. JS is a verification framework of jquery. With the advantages of jquery, we can quickly verify some common input, expand our own verification methods, and provide good support for internationalization.
It's easy to use this function. See the
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.