You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: entries/serialize.xml
+11-33Lines changed: 11 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -6,45 +6,25 @@
6
6
</signature>
7
7
<desc>Encode a set of form elements as a string for submission.</desc>
8
8
<longdesc>
9
-
<p>The <code>.serialize()</code> method creates a text string in standard URL-encoded notation. It operates on a jQuery object representing a set of form elements. The form elements can be of several types:</p>
<p>The <code>.serialize()</code> method can act on a jQuery object that has selected individual form elements, such as <code><input></code>, <code><textarea></code>, and <code><select></code>. However, it is typically easier to select the <code><form></code> tag itself for serialization:</p>
30
-
<pre><code>$('form').submit(function() {
31
-
alert($(this).serialize());
32
-
return false;
9
+
<p>The <code>.serialize()</code> method creates a text string in standard URL-encoded notation. It can act on a jQuery object that has selected individual form controls, such as <code><input></code>, <code><textarea></code>, and <code><select></code>: <code>$( "input, textarea, select" ).serialize();</code></p>
10
+
<p>It is typically easier, however, to select the <code><form></code> itself for serialization:</p>
<p>In this case, jQuery serializes the successful controls within the form.</p>
36
16
<p><strong>Warning:</strong> selecting both the form and its children will cause duplicates in the serialized string.</p>
37
17
<p>Note: Only <ahref="http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2">"successful controls"</a> are serialized to the string. No submit button value is serialized since the form was not submitted using a button. For a form element's value to be included in the serialized string, the element must have a <code>name</code> attribute. Values from checkboxes and radio buttons (<code>input</code>s of type "radio" or "checkbox") are included only if they are checked. Data from file select elements is not serialized.</p>
38
18
</longdesc>
39
19
<example>
40
-
<desc>Serialize a form to a query string, that could be sent to a server in an Ajax request.</desc>
20
+
<desc>Serialize a form to a query string that could be sent to a server in an Ajax request.</desc>
0 commit comments