We help IT Professionals succeed at work.

How can I pass a form value from one page to another and another.

MadIce
MadIce asked
on
Medium Priority
125 Views
Last Modified: 2020-03-03
Trying to pass a form value from page to page to page. On the first page have a dropdown inside a form and passes value to my next page. On that next page, I have this code:
<cfparam name="Form.SerialNumber" default="">

I have an cfinclude statement that passes that on to another page that works fine. But I also have a form on this same page that I want to pass the SerialNumber onto. So I tried this within a form:
<form name="ChartExport" id="ChartExport" action="ChartExportProcess.cfm" method="post">
        	<INPUT type="hidden" name="SerialNumber" VALUE="#Form.SerialNumber#">
        <h6>Click on "DownLoad Files" to export to excel for processing</h6>
        <p align="center">
          <input name="btnsubmit" type="submit" class="btnsubmit" value="Download Files">
        </p>
      </form>

Open in new window


so on the ChartExportProcess.cfm page I tried this for a test:
<cfparam name="Form.Dodic" default="">
<cfdump var="#Form.Dodic#" >

But I just get #Form.Dodic#.

What am I doing wrong? would try session but at the moment not an option.
Comment
Watch Question

CERTIFIED EXPERT
Commented:
It looks like you need to enclose your form in a cfoutput block.

<cfoutput>
<form name="ChartExport" id="ChartExport" action="ChartExportProcess.cfm" method="post">
              <INPUT type="hidden" name="SerialNumber" VALUE="#Form.SerialNumber#">
        <h6>Click on "DownLoad Files" to export to excel for processing</h6>
        <p align="center">
          <input name="btnsubmit" type="submit" class="btnsubmit" value="Download Files">
        </p>
</form>
</cfoutput>

Author

Commented:
That was the issue. I keep forgetting about the cfoutput. I was adding to the last page and never looked to see if needed on the other. Thank You.
CERTIFIED EXPERT

Commented:
Glad you got it worked out!
Good luck ...

Explore More ContentExplore courses, solutions, and other research materials related to this topic.