title: JavaScript Suddenly not working - TypeError: document.hform.sSecureUser is undefined
body: <p>My Code:</p>
  
  <pre><code>  &lt;?php include ($_SERVER['DOCUMENT_ROOT'].'/functions/functions.php');?&gt;
      &lt;div id="hasJavaScript"&gt;
      &lt;form name="signup"&gt;
          &lt;label&gt;Username&lt;/label&gt; &lt;input type="text" name="user_temp" size=32 maxlength=32&gt;&lt;span&gt;alphanumeric, no spaces&lt;/span&gt;&lt;br&gt;
          &lt;label&gt;Type password&lt;/label&gt; &lt;input type="password" name="pass_temp1" size=32 maxlength=32&gt;&lt;span&gt;alphanumeric, 8-12 long&lt;/span&gt;&lt;br&gt;
          &lt;label&gt;Retype password&lt;/label&gt; &lt;input type="password" name="pass_temp2" size=32 maxlength=32&gt;&lt;br&gt;
          &lt;label&gt;Email&lt;/label&gt; &lt;input type="text" name="email_temp" size=32 maxlength=32&gt;&lt;br&gt;
          &lt;label&gt; What is: &lt;/label&gt;&lt;?php $captchaArray = myCaptcha(); echo $captchaArray['equation'];?&gt;&lt;br&gt;
          &lt;label&gt;Answer&lt;/label&gt;&lt;input type="text" name="answer1"&gt;
          &lt;input onClick="passResponse(); return false;" type="submit" name="submitbtn" value="Signup Now"&gt;
      &lt;/form&gt;
  
      &lt;form action="/action/signup-action.php" METHOD="POST" name="hform"&gt;
              &lt;input type="hidden" name="sSecureUser"&gt;
              &lt;input type="hidden" name="sSecurePass1"&gt;
              &lt;input type="hidden" name="sSecurePass2"&gt;
              &lt;input type="hidden" name="secureEmail"&gt;
              &lt;input type="hidden" name="answer2"&gt;
              &lt;input type="hidden" name="checker" value=".&lt;?php echo $captchaArray['answer'];?&gt; ."&gt;
      &lt;/form&gt;
      &lt;/div&gt;
  
      &lt;noscript&gt;
      &lt;div id="noscript"&gt;
      &lt;form method="POST" action="/action/signup-action.php" name="signup"&gt;   
          &lt;label&gt;Username&lt;/label&gt; &lt;input type="text" name="sNakedUser"&gt;&lt;span&gt;alphanumeric, no spaces&lt;/span&gt;&lt;br&gt;
          &lt;label&gt;Type password&lt;/label&gt; &lt;input type="password" name="sNakedPass1"&gt;&lt;span&gt;alphanumeric, 8-12 long&lt;/span&gt;&lt;br&gt;
          &lt;label&gt;Retype password&lt;/label&gt; &lt;input type="password" name="sNakedPass2"&gt;&lt;br&gt;
          &lt;label&gt;Email&lt;/label&gt; &lt;input type="text" name="nakedEmail"&gt;&lt;br&gt;
          &lt;input onClick="passResponse(); return false;" type="submit" name="submitbtn" value="Signup Now"&gt;
      &lt;/form&gt;
      &lt;/div&gt;
      &lt;/noscript&gt;
      &lt;title&gt;Sign Up Form&lt;/title&gt;
      &lt;script language="javascript" src="/js/md5.js"&gt;&lt;/script&gt;
      &lt;script language="javascript"&gt;
      &lt;!--
      document.getElementById('hasJavaScript').style.display = 'block';
  
    function passResponse() {
  document.hform.sSecureUser.value = MD5(document.signup.user_temp.value);
  document.hform.sSecurePass1.value = MD5(document.signup.pass_temp1.value);
  document.signup.pass_temp1.value = "";
  document.hform.sSecurePass2.value = MD5(document.signup.pass_temp2.value);
  document.signup.pass_temp2.value = "";
  document.hform.secureEmail.value = MD5(document.signup.email_temp.value);
  document.hform.answer2.value = document.signup.answer1.value;
  document.signup.answer1.value = "";
  document.hform.submit();
  
  }
      // --&gt;
      &lt;/script&gt;
  </code></pre>
  
  <p>My Problem: </p>
  
  <p>code was working fine until i added :</p>
  
  <pre><code>&lt;label&gt; What is: &lt;/label&gt;&lt;?php $captchaArray = myCaptcha(); echo $captchaArray['equation'];?&gt;&lt;br&gt;
      &lt;label&gt;Answer&lt;/label&gt;&lt;input type="text" name="answer"&gt;
  
   &lt;input type="hidden" name="answer"&gt;
          &lt;input type="hidden" name="checker" value=".&lt;?php echo $captchaArray['answer'];?&gt; ."&gt; 
  
  document.hform.answer2.value = document.signup.answer1.value;
  document.signup.answer1.value = "";
  </code></pre>
  
  <p>... Now even when i removed those lines I get this error: "TypeError: document.hform.sSecureUser is undefined "</p>
  
  <p>My URL is returning this when it breaks: </p>
  
  <pre><code>http://localhost/?user_temp=aaa&amp;pass_temp1=aaa&amp;pass_temp2=aaa&amp;email_temp=aaa&amp;answer1=1&amp;submitbtn=Signup+Now
  </code></pre>