title: SCRIPT5009: 'setShowCard' is undefined in internet explorer
body: <p>I'm getting the above error on one page in my Struts web application in IE10, but not in  chrome or firefox. Edit: doesn't work in any version of internet explorer</p>
  
  <p>The javascript function that is apparently undefined is defined on the JSP that calls it. I have looked at other questions involving this error, but they all seem to be a problem with .Net or jQuery, which are not used in this page (though jQuery is used elsewhere in the application).</p>
  
  <p>Here is a cut down version of the JSP:
  (sorry it's still huge, I didn't write it, so couldn't be sure what wouldn't be relevant)</p>
  
  <pre><code>&lt;%@ taglib uri="/tags/struts-bean" prefix="bean" %&gt;
  &lt;%@ taglib uri="/tags/struts-html" prefix="html" %&gt;
  &lt;%@ taglib uri="/tags/struts-logic" prefix="logic" %&gt;
  &lt;%@ taglib uri="/tags/XXX" prefix="XXX" %&gt;
  &lt;%@ taglib uri="/tags/struts-tiles" prefix="tiles" %&gt;
  
  &lt;tiles:insert page="/templates/acceptance-layout.jsp" flush="false"&gt; 
    &lt;tiles:put name="pagename" value="paymentdetails" type="String" /&gt;
    &lt;tiles:put name="errors" type="String"/&gt;
    &lt;tiles:put name="body" type="String"&gt;    
  
              &lt;script language="JavaScript" type="text/javascript"&gt;
                  &lt;!-- 
                  autoCompOff('PaymentDetailsForm'); 
                  --&gt;
                  function setShowCard(value){
                      if(value != ""){
                          if(value == "F" || value == "O")                        
                          document.getElementById("isPageReloaded").value = "Y";  
                          else if(value == "N" || value == "S")
                          document.getElementById("isPageReloaded").value = "N";                  
                      }                                       
                  }
              &lt;/script&gt; 
  
              &lt;html:form action="PaymentDetails" method="POST"&gt;
  
                  &lt;input type="hidden" id="redirectLink" name="redirectLink" value=""/&gt;
                  &lt;input type="hidden" name="totalprice" value="&lt;bean:write name='wrapper' property='totalPrice' /&gt;" /&gt;
                  &lt;input type="hidden" name="paymentdetails.recalc" value="" /&gt;     
                  &lt;input type="hidden" id="showWaitertPage" name="showWaitertPage" value="md-loading"/&gt;               
  
                  &lt;section class="content-main"&gt;
                      &lt;div class="inner-content"&gt;
                         &lt;div class="box box-summary"&gt;
                              &lt;div class="box-body"&gt;
                                  &lt;label for="cardowner" class="form-label"&gt;Whose card is this&lt;/label&gt;
  
                                      &lt;bean:define id="styleClass"&gt;&lt;bean:write name="PaymentDetailsForm" property="styleClass" /&gt;&lt;/bean:define&gt;
                                       &lt;XXX:select  property="cardHolder" id="cardowner" styleClass="&lt;%=styleClass %&gt;"  onchange="setShowCard(this.value)" required ="required"&gt;
                                              &lt;XXX:xxxOptionsCollection name="cardHolderList" /&gt;
                                              &lt;input type="hidden" id="isPageReloaded"  name="pageReload" value="N" /&gt;
                                       &lt;/XXX:select&gt; 
                  &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt; &lt;!-- END .inner-content --&gt;  
                  &lt;/section&gt;
                      &lt;script&gt;
                          applyCreditCardCharge(document.PaymentDetailsForm,document.PaymentDetailsForm.cardType.value);
                      &lt;/script&gt;
  
              &lt;/html:form&gt;
  
      &lt;/tiles:put&gt;
  &lt;/tiles:insert&gt;
  </code></pre>
  
  <p>And here is the html that I get from the developer tools on IE10:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;!-- HTML5 Boilerplate --&gt;
  &lt;!--[if lt IE 7]&gt;&lt;html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"&gt; &lt;![endif]--&gt;
  &lt;!--[if (IE 7)&amp;!(IEMobile)]&gt;&lt;html class="no-js lt-ie9 lt-ie8" lang="en"&gt;&lt;![endif]--&gt;
  &lt;!--[if (IE 8)&amp;!(IEMobile)]&gt;&lt;html class="no-js lt-ie9" lang="en"&gt;&lt;![endif]--&gt;
  &lt;!--[if gt IE 8]&gt;&lt;!--&gt; &lt;html class="no-js gt-ie8" lang="en"&gt;&lt;!--&lt;![endif]--&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;base href="http://XXX/pages/paymentdetails.jsp"&gt;
  
              &lt;script src="scripts/libs/modernizr-2.6.2.js"&gt;&lt;/script&gt;
              &lt;script src="scripts/util.js?v1.9"&gt;&lt;/script&gt;
              &lt;script src="scripts/libs/jquery-1.10.2.min.js"&gt;&lt;/script&gt;
              &lt;script src="scripts/form.js?v1.0"&gt;&lt;/script&gt;
  
  &lt;meta name = "format-detection" content = "telephone=no"&gt;
  &lt;/head&gt;
  
  &lt;body id="top" class="annual js-form"&gt;
  &lt;div id="outer-wrap"&gt;
  
              &lt;script language="JavaScript" type="text/javascript"&gt;
                  &lt;!-- 
                  autoCompOff('PaymentDetailsForm'); 
                  --&gt;
                  function setShowCard(value){
                  console.log("got here");
                      if(value != ""){
                          if(value == "F" || value == "O")                        
                          document.getElementById("isPageReloaded").value = "Y";  
                          else if(value == "N" || value == "S")
                          document.getElementById("isPageReloaded").value = "N";                  
                      }                                       
                  }
              &lt;/script&gt; 
  
              &lt;form name="PaymentDetailsForm" method="POST" action="/XXX/PaymentDetails.do"&gt;
  
                  &lt;input type="hidden" id="redirectLink" name="redirectLink" value=""/&gt;
                  &lt;input type="hidden" name="totalprice" value="1963.66" /&gt;
                  &lt;input type="hidden" name="paymentdetails.recalc" value="" /&gt;     
                  &lt;input type="hidden" id="showWaitertPage" name="showWaitertPage" value="md-loading"/&gt;               
  
                  &lt;section class="content-main"&gt;
                      &lt;div class="inner-content"&gt;
                          &lt;div class="box box-editable editing js-show-hide"&gt;
                              &lt;div class="box-body"&gt;                              
                                  &lt;div class="form-row editable js-ufs"&gt;
                                      &lt;label for="cardowner" class="form-label"&gt;Whose card is this&lt;/label&gt;                                    
                                       &lt;select name="cardHolder" id="cardowner" required="required" onchange="setShowCard(this.value)" class="js-ufs-trigger"&gt;&lt;option value="" selected="selected"&gt;&lt;/option&gt;
  &lt;option value="N"&gt;User&lt;/option&gt;
  &lt;option value="S"&gt;Partner/Spouse&lt;/option&gt;
  &lt;option value="F"&gt;Family member&lt;/option&gt;
  &lt;option value="O"&gt;Other&lt;/option&gt;
                                              &lt;input type="hidden" id="isPageReloaded"  name="pageReload" value="N" /&gt;&lt;/select&gt; 
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;                                  
                      &lt;/div&gt; &lt;!-- END .inner-content --&gt;  
                  &lt;/section&gt;
  
                      &lt;script&gt;
                          applyCreditCardCharge(document.PaymentDetailsForm,document.PaymentDetailsForm.cardType.value);
                      &lt;/script&gt;
              &lt;/form&gt;        
  &lt;/div&gt;
              &lt;script src="scripts/helpers.js"&gt;&lt;/script&gt;
              &lt;script src="scripts/conditional-loader.js?v0.9"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Any help would be very much appreciated.</p>