php - JavaScript Suddenly not working - TypeError: document.hform.sSecureUser is undefined -
my code:
<?php include ($_server['document_root'].'/functions/functions.php');?> <div id="hasjavascript"> <form name="signup"> <label>username</label> <input type="text" name="user_temp" size=32 maxlength=32><span>alphanumeric, no spaces</span><br> <label>type password</label> <input type="password" name="pass_temp1" size=32 maxlength=32><span>alphanumeric, 8-12 long</span><br> <label>retype password</label> <input type="password" name="pass_temp2" size=32 maxlength=32><br> <label>email</label> <input type="text" name="email_temp" size=32 maxlength=32><br> <label> is: </label><?php $captchaarray = mycaptcha(); echo $captchaarray['equation'];?><br> <label>answer</label><input type="text" name="answer1"> <input onclick="passresponse(); return false;" type="submit" name="submitbtn" value="signup now"> </form> <form action="/action/signup-action.php" method="post" name="hform"> <input type="hidden" name="ssecureuser"> <input type="hidden" name="ssecurepass1"> <input type="hidden" name="ssecurepass2"> <input type="hidden" name="secureemail"> <input type="hidden" name="answer2"> <input type="hidden" name="checker" value=".<?php echo $captchaarray['answer'];?> ."> </form> </div> <noscript> <div id="noscript"> <form method="post" action="/action/signup-action.php" name="signup"> <label>username</label> <input type="text" name="snakeduser"><span>alphanumeric, no spaces</span><br> <label>type password</label> <input type="password" name="snakedpass1"><span>alphanumeric, 8-12 long</span><br> <label>retype password</label> <input type="password" name="snakedpass2"><br> <label>email</label> <input type="text" name="nakedemail"><br> <input onclick="passresponse(); return false;" type="submit" name="submitbtn" value="signup now"> </form> </div> </noscript> <title>sign form</title> <script language="javascript" src="/js/md5.js"></script> <script language="javascript"> <!-- 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(); } // --> </script>
my problem:
code working fine until added :
<label> is: </label><?php $captchaarray = mycaptcha(); echo $captchaarray['equation'];?><br> <label>answer</label><input type="text" name="answer"> <input type="hidden" name="answer"> <input type="hidden" name="checker" value=".<?php echo $captchaarray['answer'];?> ."> document.hform.answer2.value = document.signup.answer1.value; document.signup.answer1.value = "";
... when removed lines error: "typeerror: document.hform.ssecureuser undefined "
my url returning when breaks:
http://localhost/?user_temp=aaa&pass_temp1=aaa&pass_temp2=aaa&email_temp=aaa&answer1=1&submitbtn=signup+now
Comments
Post a Comment