Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Info from one HTML Page to Another 1

Status
Not open for further replies.

bsquared18

Technical User
Jun 10, 2001
329
US
I'm new to Javascript, so please let me know the solution for the following scenario, if a solution is possible:

The user types information in one or more text boxes on an html page and then clicks a button that both submits the data to a "summary" html page (described below) and also takes the user to the next step, which is another html page where different info needs to be filled in.

The user repeats this process three or four more times.

After typing in info on the final input page, on the click of a button the user is taken to the "summary" html page where all the data that has been entered has been gathered on a form. The user can then either print out that form or e-mail it to a designated party.

Thanks!

Bill B.

 
You would be best using ASP instead of javascript.

If you include all of the text boxes in a form on an ASP page then you can transfer data from page to page easily.

have alook at this page, it describes asp with forms and submitting and requesting data.

 
I'm not familiar with ASP. On the site that you reference, it is mentioned that ASP cannot be run on a computer using Windows XP Home edition. Does that mean if someone accesses my website using a computer with Windows XP, any forms using ASP code would not work for them?

Is ASP the only option? In other words, is it impossible to accomplish what I am envisioning using Javascript?

Thanks,

Bill B.
 
One way is to use a frameset with a single frame.
Each time you switch to a new screen use target="TEXT" (using this example) and all screens will have access to the framset variable by referring to it as top.myvar

<html><head>
<script language=&quot;Javascript&quot;>
myvar=&quot;xxx&quot;;
</script>
<title>FRAME</title></head>
<frameset>
<frame src=&quot;text1.htm&quot; name=&quot;TEXT&quot;>
</frameset>
</html> Clive
 
Clive,

Do you happen to know of a website you could refer me to that uses this method, so I could see it in action and view the source code?

Thanks!

Bill B.
 
No, I am afraid I cannot think of one. However to further illustrate the concept, use the frameset code with these two frames.

TEXT2.HTM
<html><head><title>Text 1</title></head>
<body style=&quot;background:cyan&quot;>
<script>
document.write(top.myvar)
</script>
<br /><a href=&quot;text2.htm&quot; target=&quot;TEXT&quot;>next</a>
</body></html>

TEXT2.HTM
<html><head><title>Text 2</title></head>
<body style=&quot;background:yellow&quot;>
<script>
document.write(top.myvar)
</script>
<br /><a href=&quot;text1.htm&quot; target=&quot;TEXT&quot;>previous</a>
</body></html>
Clive
 
Clive,

Thanks! I've entered your code into my editor and started playing around with it. I'll need to work at incorporating it with a way for the user to input the data into a text box, but it looks like your idea has a lot of possibilities.

I'll have to spend some time getting smarter on how to use Javascript, frameset, etc.

Much appreciated!

Bill B.
 
Bill,

Try this for TEXT1.HTM, all form elements can be referenced in javascript.

TEXT1.HTM
<html><head><title>Text 1</title></head>
<body style=&quot;background:cyan&quot;>
<script>
document.write(top.myvar);
function updateMyvar() {
top.myvar=document.form1.field1.value;
}
</script>
<form name=&quot;form1&quot;><br />
<table><tr><td align=&quot;right&quot;>Field 1: </td>
<td align=&quot;left&quot;><input name=&quot;field1&quot; type=&quot;text&quot; size=&quot;8&quot; />
</td></tr></table><br />
<input type=&quot;button&quot; value=&quot; Submit &quot; onclick=&quot;updateMyvar()&quot; />
</form>
<br /><a href=&quot;text2.htm&quot; target=&quot;TEXT&quot;>next</a>
</body></html>
Clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top