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

Form action help

Status
Not open for further replies.

jeff1

IS-IT--Management
Nov 8, 2000
49
US
I would like to include the same form in many pages and post the form back to itself. How can I specify the form to post back to itself without using the url, because the url will not be the same. I am experiencing a brain block on this one guys.

Thanks in advance for your help
 
That is my favourite trick. Here are two handy expressions:

The Logical Path to this file: #GetDirectoryFromPath(ExpandPath("*.*"))#

The FileName of this File: #GetFileFromPath(GetCurrentTemplatePath())#<br>

so... your form would look like..
(don't forget the CFOUTPUT tags :)

<form action=&quot;#GetFileFromPath(GetCurrentTemplatePath())#&quot; ...
 
Oops... some extra spacing is in order...

That is my favourite trick. Here are two handy expressions:

The Logical Path to this file:
#GetDirectoryFromPath(ExpandPath(&quot;*.*&quot;))#

The FileName of this File:
#GetFileFromPath(GetCurrentTemplatePath())#<br>

so... your form would look like..
(don't forget the CFOUTPUT tags :)

<form action=&quot;#GetFileFromPath(GetCurrentTemplatePath())#&quot; ...
 
Thanks, Works Great

ColdFusion takes the possable right out of impossable
 
Is there a reason that the #GetFileFromPath(GetCurrentTemplatePath()) returns uppercase characters ?
 
Yes, CFFILE defaults its resulting variables to upper case.. so you might want to use lcase(x) when specifying a file's name before creating, or displaying to the screen. Lcase makes the string lower case.

 
I have found that sinse I am &quot;including&quot; the page I must use &quot; #GetFileFromPath(getbasetemplatepath())#&quot; . When using &quot;#GetFileFromPath(GetCurrentTemplatePath())#&quot; the file from the include path was returned.

I want to thank you guys for your help I am a self learning CF guy and without help from people like you I would still be wadding in the world of stagnant pages.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top