Solved

ColdFusion - How to pass form variables from a form thru a CFGrid page to a 3rd data display page

Posted on 2004-08-09
2
627 Views
Last Modified: 2013-12-16
This is a pretty urgent question.

I have a set of pages I am trying to input form filter data, pass it thru a cfgrid page (which uses it as a filter criteria to get the query data), and pass it to a third page, which will end up using the variable as a form variable.

User selects optionA and optionB.

Both are passed to cfgrid where I display the grid data based on query output that matches optionA, and where optionB (which is one of 6 fields in the table) = Yes.

I.E.:

<cfif #form.OptionB# eq 'Arrangements'>

<cfquery name="LookupTask" datasource="#session.datasource#" >
Select RecNum,OptionA,fld2, fld3, fld4, fld5, Authorization, Reconciliation, Payment, Administration, Accountability
FROM TableA
WHERE fld5 = 'Yes' and OptionA = '#form.OptionA#' and Arrangements = 'Yes';
</cfquery>
      <cfoutput><input type=hidden name="tempOptionB" value="Arrangements"></cfoutput>
      <cfif #LookupTask.RecordCount# eq 0 >
            <Script>alert("There are no Records ready at this time.");
             location.href="first form";
             </script>
      <cfelse>
                       show cfgrid   (select record number to get to next page)

                </cfif>

When I get to the 3rd page, I am getting errors that the tempOptionB does not exist.  I have even tried setting it as a cfparam and a session variable.  The value just won't pass thru the grid page to the next page.

 Thanks in advance!

ptslv

Any ideas as to how I can accomplish this in the next 24 hours would be greatly appreciated!
0
Comment
Question by:ptslv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
Ike23 earned 500 total points
ID: 11758335
I'm not sure if you are using a form but you could try passing the values as hidden form fields.  This is a tag by Ben Forta that is easy to use and automatically takes any form fields and creates hidden fields to pass to the next page...

http://www.macromedia.com/cfusion/exchange/index.cfm?view=sn131&extID=1000001

The tag is called cf_embedfields  The link to the tag is also here:

http://www.forta.com/cf/tags/

Hope that helps.

Ike
0
 

Author Comment

by:ptslv
ID: 11772457
Thanks for the response, Ike.  I relooked at my code.  I was using a hidden field at one point, which didn't work.  The hidden variable would pass to the second page, which was the grid page, but then it would drop out.  So I changed it to a session variable, which I could update.  I found that I had set the session variable in the wrong place.  

I haven't tried the cf_embedfields, but I will take a look at it for future reference.  Again, thanks for the help.

ptslv
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

763 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