Solved

How do i keep my form variables.

Posted on 2004-08-04
4
200 Views
Last Modified: 2013-12-24
Hi

I have a form and and action page.  In the action page,

1.  i have a query to check if the record exist - this works well
2.  I have another query that if it doesn't exist, insert it - this works well too.

So the pages in this process are:

>>Form page
>>ActionPage1 (also includes a little form that has CANCEL and ADD ANYWAY Buttons)
>>ActionPage2 (to process the ADD ANYWAY)

Now, I also have another button that says "ADD ANYWAY".  I created another Action Page (which is now ActionPage2  to process the "Add ANYway"  but I lost the Form variables already because I came from an action page.  How do i keep my form variables from "Form Page" to the "ActionPage2"

Thanks

0
Comment
Question by:mdbbound
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
dutchfoxer earned 250 total points
ID: 11722285
This you could solve with HTML form hidden fields. In the CFM file where asked to Add-anyway.... there you write as hidden fields the values from the previous form. Something like this:

<form action="ActionPage2.cfm" method="post" name="addanyway">
  <cfoutput>
     <input type=hidden name="name" value="#form.name#">
     <input type=hidden name="city" value="#form.city#">
<p>Are you sure you want to insert #form.name# ?</p>
</output>
<input type="submit" name="Submit" value="Update">
</form>


This way the values name and city are pasted to script/file "ActionPage2.cfm"

Is this what you meant?
0
 
LVL 17

Assisted Solution

by:anandkp
anandkp earned 250 total points
ID: 11723293
Well looks like u want to carry ur form variables from "Form Page" to "ActionPage1" to "ActionPage2" - RIGHT ?

U cld use Hiddenfields - as mentioned above - or u cld set them up in session/cookies - so u dont need to submit them again & bother abt it .... its upto u to decide how u wanna set it up. [having them in sessions/cookies - avoids the over heads of submitting again + maintaining it with care incase u go back & forth with the forms ...]

K'Rgds
Anand
0
 

Author Comment

by:mdbbound
ID: 11723486
Thanks to both of you.  I tried to read something about hidden fields and I'm just beginning to realized the power of hidden fields.

Thanks again

Anandkp, thanks for being there always ready to support new struggling developers like me.
0
 
LVL 17

Expert Comment

by:anandkp
ID: 11723825
:)
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question