MadIce
asked on
ColdFusion how to keep variable values when posting same form.
I have a search cfm form that passes user inputs to another form. Call it test.cfm. It takes the inputs and passes to cfc to return a query results. works fine. problem is I have a create excel button that is supposed to open excel with the results. It opens but with no results. this is done on the posting of the same test.cfm form so looks like I lose my form variables from the search file. So how do I either save those values when posting same page or store the query results? Session variable? not sure how to do that.
Trying to learn ColdFusion.
Trying to learn ColdFusion.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
then you have to p;ass the items as variables on the call to the next form or use session or other cookies or write the query to a database and retrive from the database ... GDEMARIA's solution is cleaner
ASKER
I'll give this a try at some point today. Thank you.
ASKER
When I was looking at this, I realized I've done this already. I was trying to separate the code. So was trying to use an include to handle the calling of the query and displaying the data. Does that make sense?
Sure, if there's a lot of code, you can place action handling in one file and include it in the other. Or vise-versa
ASKER
That's the problem I'm having. for example form.model is not is not passing to the next form for some reason.
ASKER
Sorry for long delay. I had more learning to do to understand. The posts to itself help and I had variable reference issues. I was able to pass to next form which calls to my query. Thank you for the information. makes more sense now.