Ticket #5262 (closed bug: fixed)
Buttonset not working on inputs with Arrays in name Attribute
|Reported by:||Zidane||Owned by:||scott.gonzalez|
|Keywords:||buttonset input name array||Cc:|
I had some radiobuttons on my page. They all had a name with arrays (happens quite a lot with cakePHP). As an example one of those radiobuttons:
<input type="radio" id="option1" name="data[Options][Fieldname]" value="1" /><label for="option1">Test1</label>
When I tried to use a buttonset on a group of these (with the same name) the buttonset did not work correctly: When clicked I could activate all the buttons which should not work with radiobuttons. But I could not deactivate any of the buttons.
After a little search in the source I found a solution that works for me... I had to alter 2 lines in the jquery.ui.button.js file:
The 2 lines:
radios = $( form ).find( "[name=" + name + "]" );
radios = $( "[name=" + name + "]", radio.ownerDocument )
My change: Replacing the
"[name=" + name + "]"
'[name="' + name + '"]'
So that the name variable doesn't break the jQuery attribute when it contains array-brackets.
- Priority changed from minor to critical
- Milestone changed from TBD to 1.8
- Owner set to scott.gonzalez
- Status changed from new to accepted
- Status changed from accepted to closed
- Resolution set to fixed