moving from one page to another

i have a input page which has a form with a listbox,two textboxes and a submit button.After users selecting a value from the listbox , typing values in the textboxes and submitting it, i have to insert those values into the database and then moveup to the next page,the actions to use those form variables in the next page (which also has a form) for inserting into the database?
i inserted these values into the database in the input form and used <cflocation url="actions.cfm"> at the end  to go to the next page, but it shows error.What can be done to this ?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

what is the error?
..... .... .. .......... ...... ....... .... (scanning) ... ........ .. ..... ... . .. .  (scanning)... ...

I'm trying to scan your brain waves to see what the error is, but I can't seem to get a hold on your brain waves!!

In all seriousness, we need to see some errors before we can comment how else do we know what is wrong?

We can guess:

- It could be that the action page expects the form variables, which are lost when you do a cflocation
- There could be a db error
- You could refer to a wrong variable name
- etc. etc.
When you do a CFLOCATION you won't be passing the variables along with it. So I'm guessing that's why the final page is bombing because it expects those variables to exist.

The easiest thing to do is pass the variables via URL onto the final page. Eg:

<CFLOCATION URL="actions.cfm?Var1=Value1&Var2=Value2">

The second easiest way would be instead of cflocation to build an html page with a hidden form that submits on load. Eg:

<body OnLoad="document.form.submit()">

<form action="actions.cfm">
  <input type="hidden" name="Field1" value="#FORM.Field1#">
  <input type="hidden" name="Field2" value="#FORM.Field2#">
  <input type="hidden" name="Field3" value="#FORM.Field3#">

- Tariq Ahmed.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I did the same guessing work already...
To put these forms in the database you should use something like this:

<form action="page2.cfm">
<input type=text name=var1>
<input type=submit>

<cfquery datasource="myDsn" name="example">
INSERT INTO tblName (field1) VALUES ('#form.var1#')
<form action="action.cfm">
<input type=text name=var1 value="#var1#">
<input type=submit>

thanks! blabla..
<cfquery datasource="myDsn" name="example">
UPDATE tblName SET field1='#form.var1#'
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.