I figured this out after much effort so I thought I'd share what I came across, so others can benefit from my effort. Firefox IE and chrome 19 (the only other version I have handy) don't have a problem with this, but chrome 21 does.
If you have this radiobutton
<input type='radio' name'k1' value='v1' checked>
it will not appear checked on the page if it's in an invalid location.
For example I had
<table>
<input type='radio' name'k1' value='v1' checked>
<tr><td>table information</td></tr>
</table>
and no matter what I did, it wouldn't appear checked when the page loaded.
Using Input Radio checked property: The Input Radio checked property is used to return the checked status of an Input Radio Button. Use document. getElementById('id'). checked method to check whether the element with selected id is check or not.
To check which radio button is selected in a form, we first get the desired input group with the type of input as an option and then the value of this selection can then be accessed by the val() method. This returns the name of the option that is currently selected.
When focus moves to the group in which a radio button is selected, pressing Tab and Shift+Tab keys move focus to the radio button that is checked. Up Arrow and Down Arrow keys move focus and selection.
To make a horizontal radio button set, add the data-type="horizontal" to the fieldset . The framework will float the labels so they sit side-by-side on a line, hide the radio button icons and only round the left and right edges of the group.
Tested on Google Chrome 21.0.1180.75 and .79
<table>
<input type="checkbox" name="n" value="v" checked="checked" />
</table>
Missing the <tr><td></tr></td>
around the input element causes checked
checkboxes not to appear as checked. Additionally, when the form is submitted, those checkboxes don't come to the server-side as being checked, either!
Once the html is formatted properly, the checkboxes should appear checked as indicated by the checked
attribute:
<table>
<tr>
<td>
<input type="checkbox" name="n" value="v" checked="checked" />
</td>
</tr>
</table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With