Button: Non-button elements with the same name as a radio cause an exception
|Reported by:||reubenhelms||Owned by:|
My jsFiddle example is here http://jsfiddle.net/reubenhelms/ZtZu8/
This shows a radio set in a div that is formatted by buttonset() on a div. It also shows a hidden field that shares the same name as the radio set, but is outside the div targeted by the radio set.
Hidden fields often accompany a radio or checkbox field to send a value to the server, to denote the field exists, but nothing was selected.
When selecting an option in the radio set, a console error is generated "Uncaught Error: cannot call methods on button prior to initialization; attempted to call method 'widget'.
This error occurs because radioGroup() picks up all elements in a form that share the same name as the selected radio button, and then assumes that all items have associated buttons.
Restricting elements to the same type as the selected radio button, or restricting elements to the div of the original buttonset target would prevent this error, and allow the usage of hidden fields to denote an unselected buttonset.
Change History (13)
comment:1 Changed 4 years ago by scottgonzalez
- Resolution set to wontfix
- Status changed from new to closed
comment:10 Changed 3 years ago by tj.vantoll
- Milestone changed from 1.10.0 to none
- Resolution wontfix deleted
- Status changed from closed to reopened
- Summary changed from click of a button in a buttonset console errors on elements not a part of the button set to Button: console errors on elements not a part of the button set
comment:11 Changed 3 years ago by scottgonzalez
- Status changed from reopened to open
- Summary changed from Button: console errors on elements not a part of the button set to Button: Non-button elements with the same name as a radio cause an exception
comment:12 Changed 3 years ago by TJ VanToll
- Resolution set to fixed
- Status changed from open to closed