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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Posting info from one form to another

Status
Not open for further replies.

aojonesoa

Technical User
Apr 25, 2001
40
US
Let's say I have a form with only one text box and one submit button.

Then let's say I copied that page so that I have 2 pages, each with one text box.

How can I write code so that when the first form is submitted, the other form opens and populates the text box with the information entered in the first?

I am a novice at server side JavaScript. So please be basic.

Thanks!
 
The way that I do that is with ASP -- so if you're not opposed to server side vbscript and ASP, then here goes -- if you are, then read no further. ;-)

First page submits to the second and on the second, you just ask:

<%
dim variableName
variableName = request.form(&quot;elementName&quot;)
%>
<script language=javascript>
function fillMeIn(){
document.formName.elementName.value = <%=variableName%>;
}
</script>

then call that fillMeIn function body onLoad like this:

<body onLoad=&quot;fillMeIn();&quot;>

hope it helps! :)
Paul Prewett
 
I am a novice, so forgive the next few questions:

The first &quot;elementName&quot; is the name of the first form.
The second &quot;elementName&quot; is the name of the input (text or hidden) on the second form (the fillMeIn function).

For the last question, you probably need to know I'm using Front Page 2000. Would I rename the second form &quot;name&quot;.ASP?

I could list the second form as the confirmation page from the first form? The action I am using from the first form is to email me the results of the first form. Then I need to send the passed information (from the first form) to a custom CGI script at Verisign.

Thanks a million for your response, I am going to go ahead and try it out, so some of the questions above I may find out &quot;soon enough&quot;
 
I tried it, and for some reason it doesn't seem to be working in conjunction with the Front Page Form handler for Confirmation Pages.

I will explain further in a new post, but basically, Front Page 2000 allows you to put a &quot;Confirmation Field&quot; on the confirmation form. The way it works is that the confirmation field that Front Page puts in is a comment in the HTML page. When the form handler creates the confirmation form, it replaces the comment with text (whatever the user inputs). If I try to take this comment and put it in the &quot;Value=&quot; of the <input> it doesn't recognize it anymore.

Since I've gone this far, I might as well finish.

Since I know exactly where the text is going to be, is there a way to extract the text from it's location and populate an <input> with it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top