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

passing variables back to form from URL

Status
Not open for further replies.

Pattycake245

Programmer
Oct 31, 2003
497
CA
I have looked around other sites and can't find an example closely match ing mine. I have a cold fusion program that gets variables passed to it from a CGI page. I prefix these form variables with "form.variable" for scoping. This page then eventually leads to a submission page with URL links on the bottom to go back to the first Cold Fusion page and I am passing these variables back to this page. But, I error out because these are not form variables anymore because they are coming from a URL. I am wondering the best way to resolve this.

Quick example:

partial cold fusion code:

<!--- this intv_no comes from a CGI form --->
<cfif form.intv_no IS NOT "">
<cfif #IsNumeric(#form.intv_no#)# IS "FALSE">
<cfoutput>
<cfset request.error_message="Invalid Id Must Be Numeric And 5 Characters">
<cfinclude template="../error.cfm">
</cfoutput>
<cfexit>
</cfif>
</cfif>


<!--- this is the page which shows the link back to the previous CF page --->

<cfoutput><BR><A HREF="
make sense?
 
you could do something like this for each of the variables.

<cfif isdefined("url.var1")>
<cfset form.var1 = url.var1>
<cfelse>
<cfset form.var1 = "">
</cfif>

this assumes that if the url variable is pressent you came from the last page and are starting over.

if these values came all all the way through the form steps to the 3rd or 4th page you could set them to session variables to do the same thing.

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top