can anyone please tell me why the below javascripts doesn't work. when the correct info is key into the zip code...the page refuse to load the following page.
<!-- saved from url=(0022)http://internet.e-mail --> <title>survey part 2</title><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"><head><title>Untitled Document</title> </head><body><h1>Confirmation <br /> <br /></h1><hr />1)You do own a rifle.<br /><br />2)Is the plate easy to mount on?<br /> Easy<br /><br />3)Is the NVE bulky?<br /> No<br /><br />4)What type of control do you use?<br /> Digital<br /><br />5)Do you own any other NVE?<br /> Yes<hr /></body></html> <html> <head> <script language="JavaScript"> errorpresent=0 function validPostCode (code) { var len=code.length; var digits="0123456789"; if (len!=4) { alert("Post Code is not the correct length"); test.code.focus(); errorpresent=1; } var i; for (i=0; i<5; i++) { if (digits.indexOf(code.charAt(i))<0) { alert("first four digit must be numeric"); test.code.focus(); errorpresent=1; } } if (errorpresent == 0) { document.location.href="process.cgi" } } </script> <title>survey part 2</title> </head> <body bgcolor="black" text="green"> <p>Thanks for filling up the first part of the Survey.</p> <p>We will like to have some general information about you.</p> <hr> <p>So please fill in the second portion..Thanks</p> <form name="test" method="get"> <p>1) Your Age</p> <input type="radio" name="age" value="1">17~20 <input type="radio" name="age" value="2" checked>21~25 <input type="radio" name="age" value="3">26~35 <input type="radio" name="age" value="3">36< <p> 2) Your Sex </p> <p> <input type="radio" name="sex" value="Male" checked>Male <input type="radio" name="sex" value="Female">Female </p> <p>3) The country you live in</p> <p> <select name="country"> <option value="AU" selected>Australia <option value="HK">Hong Kong S.A.R. <option value="JP">Japan <option value="SG">Singapore </select> </p> <p>4)Zipcode</p> <input type=text name="code" size="5" maxlength="5"> <p> <input type="submit" name="Submit" value="Submit" onClick="validPostCode(code.value)"> <input type="reset" name="reset" value="Clear all the field"> </p> </form> </body> </html>
