I just spend 4 hours to read a simple radio selection via jQuery in IE9 from the following form.
1 2 3 4 5 6 | <form name="myForm" id="myForm"> <input type="radio" name="cTitle" value="1" />Mr <input type="radio" name="cTitle" value="2" />Miss <input type="radio" name="cTitle" value="3" />Mrs <input type="radio" name="cTitle" value="4" />Ms </form> |
How could this be a problem you think? Exactly a quick google search and as expected the following code worked just fine in almost all browser exept IE9 ggrrrrrr:
1 2 | var cTitle = $('input:radio:checked', '#myForm').val(); var cTitle = $('input[name=cTitle]:checked', '#myForm').val(); |
Yes the second attempt was close but i was missing the ‘ around the radio name and should have taken the “ to get the objects
1 | var cTitle = $("input[name='clientTitle']:checked").val(); |
I know a prime example of copy and paste and not really using my head.
So just in case you run into similar problems give it a try and hopefully save some time.
