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

passing form parameters with CFLOCATION?

Status
Not open for further replies.

profwannabe

Programmer
Jan 6, 2001
53
US
I have a long iterative form to build a large record submission (the information must be finalized prior to submission so iterative submissions are not possible). However, the user may need to exit from that form to add some additional data to the database, then return to the original form and continue the process. In that case, I pass the existing form parameters to the sub-form as hidden values. Then the user submits new data. This takes them to an "action page" that performs the insert query, grabs some new information based on that submission, and appends it to some of the old info. Now I need to return to the old form with both the old form parameters and the modified one preserved.

(1)One option is to have a "return to form" form submission in which I pass the form variables. (2)Another is to pass the values in the url. (3)A third I can think of is to set session variables.

I would like to automate this step (eliminate the need for option 1), not pass the values in the url (for security reasons, option 2), and not have to set session variables (option 3). Is there a way (a la cflocation) to push the user back to the old form with the form.parameter values preserved?

Thanks in advance.
 
See if this feature of CFForm will help you....

It is a preserve data attribute of cfform. If you use studio, go to cfform wizard and click the help at the bottom. It gives you an explanation of each attribute.

Also, not sure but this might be a new feature of CF v5 The only dumb questions are the ones that are never asked
 
Yeah, that's a cf 5.0 feature and I am running on 4.5. Any other ideas?
 
Never used this before but how about session variables in the form. CFParam them with a default. when returning, check for value other than default. ex.

<input type=text name=testbox <cfif #session.testbox# NEQ 'defaultvalue'>value=#session.testbox#<cfelse>value=''</cfif>

That way if the value needs to be changed outside of the form, you will have it as a session variable.

The only dumb questions are the ones that are never asked
 
twcman,

Yeah, I had thought of that too. Thus far I have avoided using session variables for this particular site and was hoping to keep that up but I may need to use them or have an additional form and pass them as hidden (which is what I have built in the interrum; annyoing but it works). Just was hoping that there was some other way I hadn't thought of to preserve the data w/o session or url params.

Thanks again for your time on this one!
 
Have you looked at possibly using the cfmodule tag?

Not sure on the specifics of your app, and could require a little recoding. But it could be an alternative. Randall2nd
 
Haven't worked with cfmodule before. If I include the form template in the template attribute, how will I pass the parameter values? Also, will this act like a cflocation in taking the user back automatically?

Thanks for the suggestion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top