form method="GET" action="result.html"> First Name: <input type="text" name="fname" /> <br /> Last Name: <input type="text" name="lname" /> <br /><br /> <input type="submit" value="Submit" /> </form>
second page is, just want to use the gup function to find the values of the the fname and lname in the URL... but method keeps getting method is not defined when i run it.
<html>
<head>
<script type="javascript">
function gup( name ){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];}
</script>
</head>
<body>
<script language="Javascript">
var ln = gup('lname');
var fn = gup('fname');
document.write(fn);
document.write(ln);
</script>
</body>
</html>

New Topic/Question
Reply



MultiQuote




|