Skip to content

Commit 075cb6a

Browse files
committed
Stop abusing .serialize() please! Close jquerygh-108.
1 parent 10648bb commit 075cb6a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

entries/serialize.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
event.preventDefault();
1313
console.log( $(this).serialize() );
1414
});</code></pre>
15-
<p>In this case, jQuery serializes the successful controls within the form.</p>
16-
<p><strong>Warning:</strong> selecting both the form and its children will cause duplicates in the serialized string.</p>
15+
<p>In this case, jQuery serializes the successful controls within the form. Only <code>form</code> elements are examined for inputs they contain, in all other cases the input elements to be serialized should be part of the set passed to the <code>.serialize()</code> method. Selecting both the form and its children in a set will cause duplicates in the serialized string.</p>
1716
<p>Note: Only <a href="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>
1817
</longdesc>
1918
<example>

0 commit comments

Comments
 (0)