By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,326 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

onchange doesn't work in IE

P: 2
For our website we have a reservation form.
When the user clicks on the radiobutton "yes" the rest of the form should appear. In FF and in Safari it works fine, but in IE it doesn't show.


headcode javascript:

Expand|Select|Wrap|Line Numbers
  1. function activate_luchthaven_retour(){
  2.                 var checkdiv = document.getElementById('bestemming_luchthaven_radio_ja');
  3.                 var retourdiv = document.getElementById('bestemming_luchthaven_retourja');
  4.                 if(checkdiv.checked == true){
  5.                     retourdiv.style.display = 'block';
  6.                 } else{
  7.                     retourdiv.style.display = 'none';
  8.                 }
  9.             }
Code inside the body

Expand|Select|Wrap|Line Numbers
  1. <td class="labeltd">Retour rit?</td>
  2.                                                 <td class="datatd">
  3.                                                     <input type="radio" name="bestemming_luchthaven_retour_radio" value="Ja" id="bestemming_luchthaven_radio_ja" onchange="activate_luchthaven_retour();"/>Ja
  4.                                                     <input type="radio" name="bestemming_luchthaven_retour_radio" value="Nee" id="bestemming_luchthaven_radio_nee" checked onchange="activate_luchthaven_retour();"/>Nee 
  5.                                                 </td>
  6.                                             </tr>
  7.                                         </table>
  8.                                         <table cellspacing="0" cellpadding="0" id="bestemming_luchthaven_retourja" class="innerTable" style="display:none;">
  9.                                             <tr>
  10.                                                 <td class="labeltd">Retour vluchtnummer:<span class="form_require_star">*</span></td>
  11.                                                 <td class="datatd"><input type="text" name="retour_luchthaven_lijnnr" id="retour_luchthaven_lijnnr" value="" /></td>
  12.                                             </tr>
  13.                                             <tr>
  14.                                                 <td class="labeltd">Retour Datum/Tijd:<span class="form_require_star">*</span></td>
  15.                                                 <td class="datatd">
  16.                                                     <span style="background-image:url(images/calendar_btn.png);background-repeat:no-repeat;margin:2px 0 0 0;float:left;cursor:pointer;width:20px;height:20px;display:block;" id="retour_datetime_btn"></span>
  17.                                                     <input id="retour_datetime" name="retour_datetime" />
  18.                                                     <script type="text/javascript">//<![CDATA[
  19.                                                         Calendar.setup({
  20.                                                             animation: false,
  21.                                                             inputField: "retour_datetime",
  22.                                                             trigger: "retour_datetime_btn",
  23.                                                             onSelect: function(){ this.hide(); $("#retour_datetime").valid(); },
  24.                                                             showTime: true,
  25.                                                             noScroll: true,
  26.                                                             dateFormat: "%d/%m/%Y %H:%M"
  27.                                                         });
  28.                                                     //]]></script>
This is not all of the code ofcourse
Jun 9 '12 #1
Share this Question
Share on Google+
2 Replies


P: 2
In this case "yes" is "ja".
I hope anyone can understand this post since some of the used terms are written in Dutch.
Jun 9 '12 #2

Dormilich
Expert Mod 5K+
P: 8,639
change the onchange to onclick (despite that is makes more sense anyways). IE has some known problems with onchange and radio buttons/checkboxes.
Jun 11 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.