I have a group of radio buttons in a div that is displayed after the user clicks a button.
<div id="quiz_take" class="media_layout quiz_panel hide">
<div class="quiz_panel_layout">
<p><b>Quiz4 Title</b></p>
<ol>
<li>
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit?</div>
<div class="ans">
<input type="radio" name="..." id="0-0" value="0" />
<label>wrong</label>
</div>
<div class="ans">
<input type="radio" name="..." id="0-1" value="1" />
<label>right</label>
</div>
<div class="ans">
<input type="radio" name="..." id="0-2" value="2" />
<label>wrong</label>
</div>
</li>
<li>
<div>Cras luctus ante a sem gravida rutrum?</div>
<div class="ans">
<input type="radio" name="..." id="1-0" value="0" />
<label>right</label>
</div>
<div class="ans">
<input type="radio" name="..." id="1-1" value="1" />
<label>wrong</label>
</div>
<div class="ans">
<input type="radio" name="..." id="1-2" value="2" />
<label>wrong</label>
</div>
</li>
<li>
<div>Fusce vulputate porta sem, ut bibendum urna lacinia in?</div>
<div class="ans">
<input type="radio" name="..." id="2-0" value="0" />
<label>wrong</label>
</div>
<div class="ans">
<input type="radio" name="..." id="2-1" value="1" />
<label>wrong</label>
</div>
<div class="ans">
<input type="radio" name="..." id="2-2" value="2" />
<label>right</label>
</div>
</li>
</ol>
<div class="fit">
<span id="submit_quiz" class="media_layout disabled-quiz-button button">Submit</span>
</div>
</div>
</div>
This works fine in every browser, except for IE8 (the qa machine is an XP environment). It even works fine in IE7 oddly enough.
The event is handled by:
// can only submit if every radio group has selected
$('div.ans input:radio').live('click', function () {
...
});
This is the click event for a button above it that shows the quiz div:
// start quiz
$('#start_quiz').click(function () {
if ($(this).hasClass('quiz-take-button')) {
$('#quiz_ready').hide();
$('#quiz_result').hide();
$('div.ans input:radio').attr('checked', false);
$('#quiz_take').show();
}
});
The radio button event was originally a .click jquery event. But I've been trying many different methods to see troubleshoot. On the first click IE8 doesn't recognize it and the button is not selected, this is the case for any button. But each subsequent click does work. It's like one of the parent elements intercepts the first click. The css styling (padding and other spacing) is also not displaying correctly until after the first click event as well.
Any thoughts?