onchange doesn't work in IE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gabriela88
    New Member
    • Jun 2012
    • 2

    onchange doesn't work in IE

    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:

    Code:
    function activate_luchthaven_retour(){
    				var checkdiv = document.getElementById('bestemming_luchthaven_radio_ja');
    				var retourdiv = document.getElementById('bestemming_luchthaven_retourja');
    				if(checkdiv.checked == true){
    					retourdiv.style.display = 'block';
    				} else{
    					retourdiv.style.display = 'none';
    				}
    			}
    Code inside the body

    Code:
    <td class="labeltd">Retour rit?</td>
    												<td class="datatd">
    													<input type="radio" name="bestemming_luchthaven_retour_radio" value="Ja" id="bestemming_luchthaven_radio_ja" onchange="activate_luchthaven_retour();"/>Ja
    													<input type="radio" name="bestemming_luchthaven_retour_radio" value="Nee" id="bestemming_luchthaven_radio_nee" checked onchange="activate_luchthaven_retour();"/>Nee 
    												</td>
    											</tr>
    										</table>
    										<table cellspacing="0" cellpadding="0" id="bestemming_luchthaven_retourja" class="innerTable" style="display:none;">
    											<tr>
    												<td class="labeltd">Retour vluchtnummer:<span class="form_require_star">*</span></td>
    												<td class="datatd"><input type="text" name="retour_luchthaven_lijnnr" id="retour_luchthaven_lijnnr" value="" /></td>
    											</tr>
    											<tr>
    												<td class="labeltd">Retour Datum/Tijd:<span class="form_require_star">*</span></td>
    												<td class="datatd">
    													<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>
    													<input id="retour_datetime" name="retour_datetime" />
    													<script type="text/javascript">//<![CDATA[
    														Calendar.setup({
    															animation: false,
    															inputField: "retour_datetime",
    															trigger: "retour_datetime_btn",
    															onSelect: function(){ this.hide(); $("#retour_datetime").valid(); },
    															showTime: true,
    															noScroll: true,
    															dateFormat: "%d/%m/%Y %H:%M"
    														});
    													//]]></script>
    This is not all of the code ofcourse
    Last edited by Dormilich; Jun 11 '12, 09:45 AM. Reason: Please use [CODE] [/CODE] tags when posting code.
  • gabriela88
    New Member
    • Jun 2012
    • 2

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

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      change the onchange to onclick (despite that is makes more sense anyways). IE has some known problems with onchange and radio buttons/checkboxes.

      Comment

      Working...