Pass a variable from page to form

W

Wayne-I-M

Hi

This may not be possible (or, more likely, be beyond my skill level).

Is it possible to pass a value from a web page to a field in an on-line form
on another page.

e.g
A user is on page XYZ.htm
They click a button to go to an on-line form
The form opens with a text box already filled in with XYZ

If someone else goes to the same form from page ABC.htm
The form field would have ABC already filled in.

Many thanks
 
W

Wayne-I-M

ooops

The form is not on a .htm page
It's on a .asp page

In case that makes a difference.
 
T

Thomas A. Rowe

1. All of your pages should have the .asp extension.

2. Create the link to the form as:

form.asp?p=xyz
form.asp?p=abc

3. On the form page you retrieve the value of "p" as:

page = Request.QueryString("p")

4. Set the initial value of the form field or hidden form field via:

<%=page%>
--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
W

Wayne-I-M

Hi Thomas

Ha Ha - lost me with that answer.

Sorry but I'm new to all this web "stuff"

I have made a form
http://www.ukopforms.co.uk/test.asp

If someone was on a page call abc and they hyperlinked to this page

how would I get the abc into the field

Any help in simple terms would be really great - many thanks for your help

--
Wayne
Manchester, England.



Thomas A. Rowe said:
1. All of your pages should have the .asp extension.

2. Create the link to the form as:

form.asp?p=xyz
form.asp?p=abc

3. On the form page you retrieve the value of "p" as:

page = Request.QueryString("p")

4. Set the initial value of the form field or hidden form field via:

<%=page%>
--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
R

Ronx

The hyperlink on abc.asp would be similar to:
<a href="formpage.asp?p=abc">form page</a>

Then follow Thomas' points 3 and 4.

3) <% page = request.QueryString("p") %> goes anywhere before the
<form tag

4) The field would be
<input type="hidden" name="sourcepage" value="<%=page%>">
--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.

http://www.rxs-enterprises.org/fp

FrontPage Support: http://www.frontpagemvps.com/




Hi Thomas

Ha Ha - lost me with that answer.

Sorry but I'm new to all this web "stuff"

I have made a form
http://www.ukopforms.co.uk/test.asp

If someone was on a page call abc and they hyperlinked to this page

how would I get the abc into the field

Any help in simple terms would be really great - many thanks for your help
 
W

Wayne-I-M

Hi Ronx

Where do I put your code line
<% page = request.QueryString("p") %>
and
<input type="hidden" name="sourcepage" value="<%=page%>">

Sorry about this but much easier in vba :)



<html>
<head>
<title>Receive User Information</title>
</head>
<body>
<p> </p>
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="_private/form_results.csv"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p><input type="text" name="T1" size="20" value="<%=page%>"></p>
</form>

</body>
</html>
 
W

Wayne-I-M

Hi Ronx and Thomas

Just wanted to thank you for you help. The links work like a dream.

Many thanks
 
Top