Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do i keep my form variables.

Posted on 2004-08-04
4
Medium Priority
?
223 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 1000 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 1000 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

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 quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

971 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