My problem is the same than this one.
Let’s say I have the following HTML code:
<input type="radio" name="test" id="banana" value="Banana" checked="true" />
<input type="radio" name="test" id="cherry" value="Cherry" />
And the javascript:
$('[type="radio"]').buttonset();
When I click the ‘Cherry’ button, JQuery UI changes the view correctly. However, $('[name="test"]').val(); returns “Banana”…
Any workaround?
To solve this problem I called
$('[name="test"]:checked').val();and it seems to work.If you want to detect a change of the radio button, do not call
$('[name="test"]').click()but$('[name="test"]').change().I hope this will help people.