Identify submitting URL in form results

H

Hugh

I want my form results to contain the page URL of the
submission page. This is because I have 10,000 pages and
I want to "include" a form on each one so the user can
submit comments about that page. I could make a different
form for each page, with a "hidden" field identifying the
page, but that would mean amending 10,000 pages if I
redesign the form ...

How do I do this? I can use "substitution" Page-URL to
display the including page url inside the included form.
This works, but it is not in the results received from the
form submission. Do I need a Java applet, or can it be
done in Frontpage 2000?
 
J

Jim Buyens

First, create a new, stand-alone page that contains your
comments form. Then siwtch to HTML view and:

1. Add this script to the <head> section.
<script>
function getReferrer(){
if (document.forms[0].hidref.value == ""){
document.forms[0].hidref.value = document.referrer;
}
}
</script>

2. Add this attribute to the <body> tag:

<body onload="getReferrer();">

3. Add this hidden form field to teh comments form:

<input type="hidden" name="hidref" value="">

4. On each of your 10,000 pages, add a simple hyperlink to
the new comments page. For example:

<a href="comments.htm">Comment on this page.</a>

The form handler should then capture the URL of the
referring page in the "hidref" form field.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top