title: 'ScrollTop' is null or not an object
body: <p>I'm adding a recaptcha to a form on A DNN website. I wanted to use the asp.net Recaptcha control but it didn't seem to allow me to resize it easily.</p>
  
  <p>I've decided to go for inserting the HTML into my page as in the example here:</p>
  
  <p><a href="https://developers.google.com/recaptcha/docs/customization" rel="nofollow">https://developers.google.com/recaptcha/docs/customization</a></p>
  
  <p>I works perfect on Chrome and Firefox..but not IE ..well at least not IE8 the version I'm using and I'm getting a javascript error 'ScrollTop' is null or not an object.  The error is occurring in dnncore.js </p>
  
  <p>The only reference to ScrollTop are in the following js functions</p>
  
  <pre><code>function __dnn_bodyscroll() { 
  var a = document.forms[0]; 
  if (__dnn_ClientAPIEnabled() &amp;&amp; __dnn_m_bPageLoaded) { 
  
  //prob seems to happen on next lineafter a.
      a.ScrollTop.value = document.documentElement.scrollTop ? document.documentElement.scrollTop : dnn.dom.getByTagName("body")[0].scrollTop 
  } 
  </code></pre>
  
  <p>} </p>
  
  <pre><code>function __dnn_setScrollTop(c) { 
  if (__dnn_ClientAPIEnabled()) { 
      if (c == null) { 
          c = document.forms[0].ScrollTop.value 
      } 
      var a = dnn.getVar("ScrollToControl");
      if (a != null &amp;&amp; a.length &gt; 0) {
          var b = dnn.dom.getById(a);
          if (b != null) {
              c = dnn.dom.positioning.elementTop(b);
              dnn.setVar("ScrollToControl", "") 
          } 
      } 
      window.scrollTo(0, c) 
  } 
  </code></pre>
  
  <p>} </p>
  
  <p>Is there an alternative to using this  ScrollTop in IE?</p>
  
  <p>The HTML for the Recpatcha is</p>
  
  <pre><code>            &lt;script type="text/javascript"&gt;
              var RecaptchaOptions = {
                  tabindex: 1,
                  theme: 'custom',
                  custom_theme_widget: 'recaptcha_widget'
              };
  
              function switchType(type) {
                  var input = document.getElementById('recaptcha_response_field');
                  if (type == 'audio') {
                      input.placeholder = "Type what you hear";
                      Recaptcha.switch_type('audio');
                  } else {
                      input.placeholder = "Type the text";
                      Recaptcha.switch_type('image');
                  }
              }
          &lt;/script&gt;
          &lt;div id="recaptcha_widget" style="display: none"&gt;
              &lt;div id="recaptcha_image"&gt;
              &lt;/div&gt;
              &lt;div class="recaptcha_input left"&gt;
                  &lt;div class="recaptcha_only_if_incorrect_sol" style="color: red;"&gt;
                      Incorrect, please try again&lt;/div&gt;
                  &lt;input type="text" id="recaptcha_response_field" name="recaptcha_response_field"
                      placeholder="Type the text" /&gt;
              &lt;/div&gt;
              &lt;div class="recaptcha_buttons left"&gt;
                  &lt;a href="javascript:Recaptcha.reload()" title="Get a new challenge" id="recaptcha_reload_btn"&gt;
                      &lt;img src="http://www.google.com/recaptcha/api/img/clean/refresh.png" id="recaptcha_reload"
                          alt="Get a new challenge" height="18" width="25"&gt;&lt;/a&gt; &lt;a href="javascript:switchType('audio');"
                              title="Get an audio challenge" id="recaptcha_switch_audio_btn" class="recaptcha_only_if_image"&gt;
                              &lt;img src="http://www.google.com/recaptcha/api/img/clean/audio.png" id="recaptcha_switch_audio"
                                  alt="Get an audio challenge" height="15" width="25"&gt;&lt;/a&gt; &lt;a href="javascript:switchType('visual')"
                                      title="Get a visual challenge" id="recaptcha_switch_img_btn" class="recaptcha_only_if_audio"&gt;
                                      &lt;img src="http://www.google.com/recaptcha/api/img/clean/text.png" id="recaptcha_switch_img"
                                          alt="Get a visual challenge" height="15" width="25"&gt;&lt;/a&gt;
                  &lt;a href="javascript:Recaptcha.showhelp()" title="Help" id="recaptcha_whatsthis_btn"&gt;
                      &lt;img alt="Help" src="http://www.google.com/recaptcha/api/img/clean/help.png" id="recaptcha_whatsthis"
                          height="16" width="25"&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;img src="http://www.google.com/recaptcha/api/img/clean/logo.png" id="recaptcha_logo"
                  alt="" height="36" width="71"&gt;
              &lt;div class="clear"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=mycaptchakey"&gt;
          &lt;/script&gt;
          &lt;noscript&gt;
              &lt;iframe src="http://www.google.com/recaptcha/api/noscript?k=mycaptchakey"
                  height="300" width="500" frameborder="0"&gt;&lt;/iframe&gt;
              &lt;br&gt;
              &lt;textarea name="recaptcha_challenge_field" rows="3" cols="40" id="recaptcha_challenge_field" /&gt;
              &lt;input type="hidden" name="recaptcha_response_field" value="manual_challenge" /&gt;
          &lt;/noscript&gt;
  </code></pre>
  
  <p>There are no two  tags in the source of the page. I've seen some reasons for the cause of this was because of that.</p>
  
  <p>Anyone came across this problem?</p>
  
  <p>Thanks,</p>