Solved

How do i keep my form variables.

Posted on 2004-08-04
4
194 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
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 …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

860 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