I'm almost purely a design view front page user.

Currently I am just copying and pasting a form and a
results field to each page. I then creating a hidden
field called FileName which I change to the current file
name manually. I then pass to the database and store it
under FileName. I also use the database results wizzard
and filter it manually using the FileName database entry.

For efficiency, I would like to have an include file that
I can reuse on all my pages. This include file would
consist of a form to collect the file name of the page
(not the include file page, but the page it was included
on). The include file will also include the database
results, filtered to only include those entries in the
database with that particular file name.

I have a hunch I can do this pretty easily by changing
some of the FrontPage code, maybe using some asp.

Here is the code I currenty use that is developed by
FrontPage. I've editted out the non-essential code. Take
a look at everywhere it says Baja3. Baja3 is what I'm
using to represent the file name. I'd like to
automatically generate this. If somebody could help me
out with this, I would be extremely greatful!

CODE FOR THE FORM THAT PASSES THE FILENAME (Baja3) TO THE
DATABASE

<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveDatabase" SuggestedExt="asp"
S-Form-Fields="FileName Email Name Comments"
S-Form-DBFields="FileName e-mail Name Comment"
<!--webbot bot="SaveDatabase" i-checksum="34604" endspan -
->
<input type="hidden" name="FileName" value="Baja3">
</form>

CODE FOR DATABASE RESULTS FILTERED BY FILENAME
<!--webbot bot="DatabaseRegionStart"
s-columnnames="ID,Name,e-mail,Comment,Date,FileName"
s-displaycolumns="ID,Name,email,Comment,Date,FileName"
<%
<%
fp_sQry="SELECT * FROM PageComments WHERE (FileName
LIKE 'Baja3') ORDER BY Date ASC"
%>

Re: Passing file name via form by MD

MD
Fri Nov 21 02:56:24 CST 2003

Hi Scott,

Actually JavaScript will work the best.

1. Create a hidden form field (FileName)
2. After the form (dashed area) include the following code.
<script>
FrontPage_Form1.FieldName.value = document.URL;
</script>


--
Mike -- FrontPage MVP '97 - '02
http://www.websunlimited.com
Our latest products "At Your Command" and IncludeASP
http://www.websunlimited.com/order/Product/AYC/ayc.htm
http://www.websunlimited.com/order/product/includeASP/includeASP.htm

"Scott" <scott@diveatlas.com> wrote in message
news:06b901c3af27$96f09380$a501280a@phx.gbl...
> I'm almost purely a design view front page user.
>
> Currently I am just copying and pasting a form and a
> results field to each page. I then creating a hidden
> field called FileName which I change to the current file
> name manually. I then pass to the database and store it
> under FileName. I also use the database results wizzard
> and filter it manually using the FileName database entry.
>
> For efficiency, I would like to have an include file that
> I can reuse on all my pages. This include file would
> consist of a form to collect the file name of the page
> (not the include file page, but the page it was included
> on). The include file will also include the database
> results, filtered to only include those entries in the
> database with that particular file name.
>
> I have a hunch I can do this pretty easily by changing
> some of the FrontPage code, maybe using some asp.
>
> Here is the code I currenty use that is developed by
> FrontPage. I've editted out the non-essential code. Take
> a look at everywhere it says Baja3. Baja3 is what I'm
> using to represent the file name. I'd like to
> automatically generate this. If somebody could help me
> out with this, I would be extremely greatful!
>
> CODE FOR THE FORM THAT PASSES THE FILENAME (Baja3) TO THE
> DATABASE
>
> <form method="POST" action="--WEBBOT-SELF--">
> <!--webbot bot="SaveDatabase" SuggestedExt="asp"
> S-Form-Fields="FileName Email Name Comments"
> S-Form-DBFields="FileName e-mail Name Comment"
> <!--webbot bot="SaveDatabase" i-checksum="34604" endspan -
> ->
> <input type="hidden" name="FileName" value="Baja3">
> </form>
>
> CODE FOR DATABASE RESULTS FILTERED BY FILENAME
> <!--webbot bot="DatabaseRegionStart"
> s-columnnames="ID,Name,e-mail,Comment,Date,FileName"
> s-displaycolumns="ID,Name,email,Comment,Date,FileName"
> <%
> <%
> fp_sQry="SELECT * FROM PageComments WHERE (FileName
> LIKE 'Baja3') ORDER BY Date ASC"
> %>