moving from one page to another

Posted on 2004-11-29
Last Modified: 2013-12-24
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 ?

Question by:jaiswalpragya
    LVL 35

    Expert Comment

    what is the error?
    LVL 17

    Expert Comment

    ..... .... .. .......... ...... ....... .... (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.
    LVL 2

    Accepted Solution

    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.
    LVL 17

    Expert Comment

    I did the same guessing work already...

    Expert Comment

    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#'

    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

    A 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…
    Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    729 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

    15 Experts available now in Live!

    Get 1:1 Help Now