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

Pass variable from page to form textbox on another page? 1

Status
Not open for further replies.

lionelbrown

Programmer
Apr 9, 2001
38
0
0
US
I'm a VB programmer just starting to learn asp, etc. I'm starting with Frontpage and moving on to Interdev after that, so if I should you can solve my issue using either product, I would greatly appreciate it!

MY QUESTION:
I've created an html page with a hover button that opens my Order.asp (contains an order form) page. I want to click the button and open the order page with a value passed into a textbox on the order form. I've tried using the <url>?<key=value> and then requesting the value on the order page, but I've run into several issues. Frontpage stomps all over my edits to the automatically generated asp form code. Any suggestions on the best way to do this? Where in the order page should I put the code to retrieve the passed value?

My web is being run on IIS, and I'm using Frontpage 2000. My form is using Post.

Thanks in advance for any help you can provide!
 
Not sure what Exactly you are looking for, but if you just want the info from a submitted form on a previous page to be able to be automatically put in as values on the form on the next page, all you need to do is request the values from the first form, then enter those variables as values for the second form:


--------------page1.asp--------------
<form action=&quot;page2.asp&quot; method=&quot;post&quot;>
First Name: <input type=&quot;text&quot; name=&quot;fname&quot;><br>
Last Name: <input type=&quot;text&quot; name=&quot;lname&quot;><Br>
<input type=&quot;submit&quot; value=&quot;Submit&quot;><input type=&quot;reset&quot; value=&quot;Reset&quot;>
</form>


--------------page2.asp--------------
<%
dim firstname, lastname
firstname = request.form(&quot;fname&quot;)
lastname = request.form(&quot;lname&quot;)

response.write(&quot;Are you sure this is correct?<br>&quot;)
response.write(&quot;<form action='page3.asp' method='post'>&quot;)
response.write(&quot;<input type='text' name='userfirst' value='&quot; & firstname & &quot;'><br>&quot;)
response.write(&quot;<input type='text' name='userlast' value='&quot; & lastname & &quot;'><br>&quot;)
response.write(&quot;<input type='submit' value='Yes'><input type='reset' value='No, Reset it!'><br>&quot;)
response.write(&quot;</FORM>&quot;)
%>


Hope this answers your question...

-Ovatvvon

 
I'm going from an html page to an asp page. However, you have answered another question I was just looking into! I was able to get the thing working using querystring, and you just saved me several hours of research for the form to form question.

Thanks for your help. I really appreciate it!
 
I think that's your answer

<form action=&quot;page2.asp?var_name=var_value&quot; method=&quot;post&quot;>
First Name: <input type=&quot;text&quot; name=&quot;fname&quot;><br>
Last Name: <input type=&quot;text&quot; name=&quot;lname&quot;><Br>
<input type=&quot;submit&quot; value=&quot;Submit&quot;><input type=&quot;reset&quot; value=&quot;Reset&quot;>
</form>

if you need to change (client) de value of the var dynamic, send me a mail

good luck
 
lionel...
the first page can also be a .html...it isn't useing any .asp scripting on it..I'm just in the habbit of calling everything asp. But you can change it to page1.html and it will do the exact same thing. the second page needs to be .asp. If that isn't what you're looking for...can you clearify a little more what you need?

-Ovatvvon
 
Ovatvvon,
What you gave me WAS very helpful (I gave you a tipmaster vote when I replied to your answer)! I wasn't very clear in my reply. I meant to say, that before you replied, I was able to answer my own question and get the page working using request.querystring. I was just in the process of figuring out form to form passing when I got notified of your reply. I will be able to take your example and tweak it to use in several situations that I will be dealing with!

I appreciate your help!
Lionel
 
Hem Hem,

I am trying to do the same thing! Actually, I am just trying to see how your things up here are working and it dosn't. (ok, I am a beginner) I have this page1.asp with the summit button. When I click, I have a white page. How pae2.asp is suppose to be?

thanks
Yannick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top