Radio controlgroup change event provides previously selected radio button
Hi there,
I am totally stuck with this issue. I have several radio controlgroups and when one of the radio buttons is clicked, its value 'id' should be read. First click works fine but then the event is thrown but displaying the previously checked button. Only when I click a second time on that new button, its value gets displayed correctly.
Please help!!! :(
- $('[data-role="page"]').bind('pageshow',function () {
- $('#term_grp').bind('change', function () {
- $("input[name*=term]:checked").each(function () {
- fillMonths($(this).attr('id'));
- });
- });
- });
- <div data-role="content">
- <div id="term_grp" data-role="fieldcontain">
- <fieldset data-role="controlgroup" data-type="horizontal">
- <legend>Semester:</legend>
- <input type="radio" name="term" id="ss"></input><label for="ss">Sommersemester</label>
- <input type="radio" name="term" id="ws" checked="checked"></input><label for="ws">Wintersemester</label>
- </fieldset>
- </div>
- <div id="month_grp"></div>
- <div id="datum_1_grp"></div>
- <div id="datum_2_grp"></div>
- <div id="zeit_1_grp"></div>
- <div id="zeit_2_grp"></div>
- <div id="min_grp"></div>
- <div id="event_grp"></div>
- </div>