WannaLearn
Programmer
Hello, I have a question. Can I pass a variable from one form to another form, on the same page?
What I want to do is, on form have the user fill out some general information then when they click a button they go to the bottom where they enter their contact info and submit the form. BUT each form is sent to a diff. email address. What I want to do is pass the 'email address' from one form to the next, so that the general information AND the contact information get emailed. Is that possible?
Thanks.
This is my code so far:
By the way, I will using cgi to email the forms. Thanks.
What I want to do is, on form have the user fill out some general information then when they click a button they go to the bottom where they enter their contact info and submit the form. BUT each form is sent to a diff. email address. What I want to do is pass the 'email address' from one form to the next, so that the general information AND the contact information get emailed. Is that possible?
Thanks.
This is my code so far:
Code:
<HTML>
<HEAD>
<script>
function goThere() {
if(document.form1.select1.options[0].selected == true) {
alert("Select Something");
return false;
}
else {
window.location.href=document.form1.select1.options[document.form1.select1.selectedIndex].value
}
}
</script>
</HEAD>
<BODY BGCOLOR="#ffffff">
<CENTER>
<br>
<table width="700" border="0" align="center">
<tr valign="top">
<td>
<center>
<table cellpadding="2" align="Center">
<tr valign="Top">
<td> <form name="form1">
<select name="select1">
<option value="">Please Select One of the Following:</option>
<option value="#Section1">Section 1</option>
<option value="#Section2">Section 2</option>
<option value="#Section1">Section 3</option>
</select>
<input type="button" value="Take me there" onClick="return goThere();">
</form></td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</center>
<hr>
<table width="700" align="center">
<tr>
<td>
<form method="get" action="">
<p>
<a name="Section1"></a><hr>
<table width="100%" cellpadding="2">
<tr>
<td width="72%"><font size="2" color="#ff0000"><b>SECTION
1 :</b></font><font size="2" color="004080"> For this
area, please enter the requested information.</font></td>
<td width="28%"> </td>
</tr>
</table>
<table width="100%" cellpadding="2">
<tr valign="middle">
<td><font size="2"><b>My question is: </b></font> <table width="90%" cellpadding="2">
<tr valign="middle">
<td width="56%"><textarea name="section 1 txt" cols="30"></textarea>
</td>
<td width="1%"> </td>
<td width="32%"><font size="2"><b><a href="#organization">continue</a></b></font></td>
<td width="11%"> </td>
</tr>
</table></td>
</tr>
</table>
</form>
<p>
<p>
<form method="GET" action="">
<a name="Section2"></a><hr>
<table width="100%" cellpadding="2">
<tr >
<td width="69%"><font face="ARIAL, TAHOMA, VERDANA" size="2" color="#ff0000"><b>SECTION
2 :</b></font><font face="ARIAL, TAHOMA, VERDANA" size="2" color="004080">
For this area, please enter the requested information.</font></td>
<td width="31%"></td>
</tr>
</table>
<table width="100%" cellpadding="2">
<tr>
<td width="575"><font size="2"><b>My question is: </b></font><BR> <table width="90%" cellpadding="2">
<tr valign="middle">
<td width="56%"><textarea name="section 2 txt" cols="30" id="section 2 txt"></textarea>
</td>
<td width="1%"> </td>
<td width="39%"><font size="2"><b><a href="#organization">continue</a></b></font></td>
<td width="4%"> </td>
</tr>
</table></td>
</tr>
</table>
</form>
<p>
<p>
<form method="GET" action="">
<font size="2" color="#ff0000"><b><a name="Section3"></a></b></font>
<hr>
<table width="100%" cellpadding="2">
<tr >
<td width="69%"><font size="2" color="#ff0000"><b>SECTION
3 :</b></font><font size="2"> For this area, please
enter the requested information.</font></td>
<td width="31%"></td>
</tr>
</table>
<table width="100%" cellpadding="2">
<tr>
<td><font size="2"><b>My question is: <br>
</b></font> <table width="90%" cellpadding="2">
<tr valign="middle">
<td width="56%"><textarea name="section 3 txt" cols="30" id="section 3 txt"></textarea>
</td>
<td width="1%"> </td>
<td width="38%"><font size="2"><b><a href="#organization">continue</a></b></font></td>
<td width="5%"> </td>
</tr>
</table></td>
</tr>
</table>
</form>
<p>
<p>
<form method="GET" action="">
<p> <br>
<p>
<hr>
<br>
<a name="organization"></a><font color="ff0000" size="2"><b>CONTINUE:</b></font><br>
<br>
<table>
<tr>
<td width=175 align=RIGHT></td>
<td></td>
</tr>
<tr valign="middle">
<td width=175 align=RIGHT><font face="ARIAL, TAHOMA, VERDANA"
size="1"><b>Your Name:</b></font></td>
<td width=300> <input type="text" name="YOUR NAME" maxlength="30" size="30">
</td>
</tr>
<tr valign="middle">
<td width=175 align="RIGHT"><font face="ARIAL, TAHOMA, VERDANA" size="1"><b>Your
Number:</b></font></td>
<td width=300> <input type="text" name="YOUR TELEPHONE NUMBER" maxlength="14" size="14">
</td>
</tr>
</table>
<br>
<input type="submit" value="Submit Your Question" name="submit">
<input type="reset" value="Reset" name="reset">
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</CENTER>
</BODY>
</HTML>
By the way, I will using cgi to email the forms. Thanks.