I have some checkboxes in each row in my table. Each one checkbox has name='myName'
because I want to select only one checkbox in each row. But something I'm missing because I'm able to check all of them:
but I want that result:
what am I missing here ?
Checkboxes are objects of a HTML form which behaves like a toggle switch. i.e, a checkbox can be in one of the two states, either checked or unchecked. From a group of checkboxs user can select multiple options.
Save this question. Show activity on this post. createElement('div', {className: 'checkbox'}, createElement('label', null, createElement('input', { type: 'checkbox', name: 'tssort', defaultChecked: !
A checkbox HTML element doesn't have a "readonly" property. Consequently, the only way to make a checkbox appear to be "readonly" is to disable the control.
The unique name identifier applies to radio buttons:
<input type="radio" />
change your checkboxes to radio and everything should be working
Checkboxes, by design, are meant to be toggled on or off. They are not dependent on other checkboxes, so you can turn as many on and off as you wish.
Radio buttons, however, are designed to only allow one element of a group to be selected at any time.
References:
Checkboxes: MDN Link
Radio Buttons: MDN Link
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