Skip to content

Commit a607d53

Browse files
gibson042kswedberg
authored andcommitted
serializeArray(): Improve description of valid input elements. Ref jQuery #15191. Closes jquery#536.
1 parent 9bf9b1f commit a607d53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

entries/serializeArray.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</signature>
77
<desc>Encode a set of form elements as an array of names and values.</desc>
88
<longdesc>
9-
<p>The <code>.serializeArray()</code> method creates a JavaScript array of objects, ready to be encoded as a JSON string. It operates on a jQuery object representing a set of form elements. The form elements can be of several types:</p>
9+
<p>The <code>.serializeArray()</code> method creates a JavaScript array of objects, ready to be encoded as a JSON string. It operates on a jQuery collection of <code>form</code>s and/or form controls. The controls can be of several types:</p>
1010
<pre><code>
1111
&lt;form&gt;
1212
&lt;div&gt;&lt;input type="text" name="a" value="1" id="a"&gt;&lt;/div&gt;
@@ -29,7 +29,7 @@
2929
&lt;/form&gt;
3030
</code></pre>
3131
<p>The <code>.serializeArray()</code> method uses the standard W3C rules for <a href="http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2">successful controls</a> to determine which elements it should include; in particular the element cannot be disabled and must contain a <code>name</code> attribute. No submit button value is serialized since the form was not submitted using a button. Data from file select elements is not serialized.</p>
32-
<p>This method can act on a jQuery object that has selected individual form elements, such as <code>&lt;input&gt;</code>, <code>&lt;textarea&gt;</code>, and <code>&lt;select&gt;</code>. However, it is typically easier to select the <code>&lt;form&gt;</code> tag itself for serialization:</p>
32+
<p>This method can act on a jQuery object that has selected individual form controls, such as <code>&lt;input&gt;</code>, <code>&lt;textarea&gt;</code>, and <code>&lt;select&gt;</code>. However, it is typically easier to select the <code>&lt;form&gt;</code> element itself for serialization:</p>
3333
<pre><code>
3434
$( "form" ).submit(function( event ) {
3535
console.log( $( this ).serializeArray() );

0 commit comments

Comments
 (0)