ptslv
asked on
ColdFusion - How to pass form variables from a form thru a CFGrid page to a 3rd data display page
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.datas ource#" >
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"></cfo utput>
<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!
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.datas
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"></cfo
<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!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I haven't tried the cf_embedfields, but I will take a look at it for future reference. Again, thanks for the help.
ptslv