Solved

How do i keep my form variables.

Posted on 2004-08-04
4
169 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
:)
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
AWS Advice on using WHM/cPanel 1 58
DNS, website, godaddy 6 40
WEB Farm 6 22
exchange 2010 turning off 3des ciphers 2 32
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now