I have this annoying problem with Internet Explorer.
First some code, so it will be easier to explain.
<input type="radio" name="rdo_keuze" id="keuze_1" value="1">keuze1</input>
<input type="radio" name="sub_rdo_keuze" id="keuze_2" value="2">keuze2</input>
<input type="radio" name="sub_rdo_keuze" id="keuze_3" value="3">keuze3</input>
<input type="radio" name="sub_rdo_keuze" id="keuze_4" value="4">keuze4</input>
<input type="radio" name="rdo_keuze" id="keuze_5" value="5">keuze5</input>
<input type="radio" name="rdo_keuze" id="keuze_6" value="6">keuze6</input>
<input type="radio" name="rdo_keuze" id="keuze_7" value="7">keuze7</input>
So the sub_rdo_keuze is a sub of rdo_keuze. When I check for example keuze_3, my page is being send to another url. When I go back to that page, My rdo_keuze is still checked and also my sub_rdo_keuze is checked correctly. But, there is a div that shouldn’t be displayed when it’s keuze_3. When I alerted my radio buttons, It seemed that he just didn’t read the sub_rdo_keuze value.
(But in firefox I didn’t get this problem)
Here’s a part of my javascript:
$(document).ready(function(){
$('input:radio:').click(function(){showdivs(this.value);});});
if($('input:radio:checked').val() == 1 && $('input[name=sub_rdo_keuze]:checked').val() != undefined){
showdivs($('input[name=sub_rdo_keuze]:checked').val());
}else{
showdivs($('input:radio:checked').val());
}
function showdivs(obj){
First I thought, maybe it’s because my page isn’t fully loaded, so I tried window.load, window.ready, but none of them worked. So does someone has an Idea what I could have done wrong?
just noticed something different: when I go back to the page, he first selects the 1 choice, but than very fast, he will change to the correct value. Only he just alerted the 1 choice.
Thank you so much in advance!
I found a solution, but it isn’t perfect. I just renamed the sub radio buttons to the parents and added a class to it. this way he read the values.