Open klokare opened 6 years ago
HTML 4 & 5 will accept the condensed version <input type="radio" value="2" checked>
but XHTML will not. So the change would need to support both versions.
<input type="radio" value="2" checked>
and
<input type="radio" value="2" checked="checked">
A fix was just done for the <select>
tag in #108. Looks like we need to extend this to <input>
tag for radio and checkbox.
The code in
serializeForm
only adds radio fields that are checked but this code also does not properly identify the checked attribute properly:s.Attr("checked")
returns an empty string even if the element is found becausegoquery.Selection.Attr
returns the value not the name of the attribute andchecked
attributes have no value, they are either present or not. Soc
will not equal "checked". Since only 1 radio input for a givenname
can be checked, the above code could be rewritten asIf you believe I am correct about this and feel like it is a good solution, I am happy to put together a pull request.