wilsond001
Technical User
I am new to javascripting and am beating my head on the wall. I am trying to get the following page/code to work. When the submit button is pushed I am trying to get the information entered displayed in a new page. I think I have the basice but am not sure what to do for the page that is getting the data.
<html>
<head>
<script type="text/javascript">
function formSubmit()
{
document.getElementById("myForm").submit()
}
function formReset()
{
document.getElementById("myForm").reset()
}
function createTarget(t){
window.open("", t, "width=600,height=550");
return true;
}
</script>
</head>
<body bgcolor=#99CCFF >
<p>Please enter the requested information in the fields below, and then press the "Submit" button to submit the form. This information will allow us to better server you. Personnel data will not be shared with any outside parties</p>
<table >
<form name=myform type=post action=results.html onsubmit="return createTarget(this.target)" target="formtarget">
<!--<form id="myForm" action="results.html" method="get">-->
<tr><td>First name:</TD> <td> <input type="text" name="firstname" size="30"></td>
<tr><td>Last name:</td> <td><input type="text" name="lastname" size="30"></td>
<tr><td>Address:</TD> <td><input type="text" name="address1" size="30"></td>
<tr> <td></td> <td><input type="text" name="address2" size="30"></TD>
<tr><td>Area Code&Phone Number:</TD><td><input type="text" name="AreaCode" size="4"><input type="text" name="PhoneNumber" size="22"></td>
<tr><td>City:</td> <td><input type="text" name="city" size="30"></td>
<tr><td>State:</td> <td><input type="text" name="state" size="30" maxlength="2"></td>
<tr><td> Zip Code:</td> <td><input type="text" name="zip" size="30" maxlength="10"/></td>
<tr><td>Email Address:</TD> <td> <input type="text" name="email" size="50"></td>
<tr><tr><td><td>
<input type="submit" value="Preview" onclick="this.form.target='_blank';return true;"/>
<!--<input type="button" onclick="formSubmit()" value="Submit">-->
<input type="button" onclick="formReset()" value="Reset">
</form>
</body>
</html>
<html>
<head>
<script type="text/javascript">
function formSubmit()
{
document.getElementById("myForm").submit()
}
function formReset()
{
document.getElementById("myForm").reset()
}
function createTarget(t){
window.open("", t, "width=600,height=550");
return true;
}
</script>
</head>
<body bgcolor=#99CCFF >
<p>Please enter the requested information in the fields below, and then press the "Submit" button to submit the form. This information will allow us to better server you. Personnel data will not be shared with any outside parties</p>
<table >
<form name=myform type=post action=results.html onsubmit="return createTarget(this.target)" target="formtarget">
<!--<form id="myForm" action="results.html" method="get">-->
<tr><td>First name:</TD> <td> <input type="text" name="firstname" size="30"></td>
<tr><td>Last name:</td> <td><input type="text" name="lastname" size="30"></td>
<tr><td>Address:</TD> <td><input type="text" name="address1" size="30"></td>
<tr> <td></td> <td><input type="text" name="address2" size="30"></TD>
<tr><td>Area Code&Phone Number:</TD><td><input type="text" name="AreaCode" size="4"><input type="text" name="PhoneNumber" size="22"></td>
<tr><td>City:</td> <td><input type="text" name="city" size="30"></td>
<tr><td>State:</td> <td><input type="text" name="state" size="30" maxlength="2"></td>
<tr><td> Zip Code:</td> <td><input type="text" name="zip" size="30" maxlength="10"/></td>
<tr><td>Email Address:</TD> <td> <input type="text" name="email" size="50"></td>
<tr><tr><td><td>
<input type="submit" value="Preview" onclick="this.form.target='_blank';return true;"/>
<!--<input type="button" onclick="formSubmit()" value="Submit">-->
<input type="button" onclick="formReset()" value="Reset">
</form>
</body>
</html>