Christina,  you can surely send the data to another page, but you had code
on the same page trying to display the results, and if you send the form to
another page, that code will never get executed.  Just put your other page
in the 'action' attribute of cfform and move the 'display' code to the new
page and you should be fine.

Dave

-----Original Message-----
From: Christina K [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 03, 2008 2:14 PM
To: cf-newbie
Subject: Re: Send option value from cfform

Dave- I do need to post to a different page, so does that mean I can't use
the code you've shared?  Is there any way to send the value of a hard-coded
cfselect option to another page?  I have another cfform on the same page
that uses a dynamically generated drop-down list; this one allows me to pass
a value to the second page and correctly outputs the related data.  I
suppose if need be I could create a mini table to house these options, but
that's probably not the best solution from the database standpoint...
Thoughts?

Thanks for all the help!

Christina

>Christina,
>
>You are comparing a "string" value to 0 and that will always return false.
>For example, you have "RegionalSearch" IS 0.  "RegionalSearch" is equal to
>RegionalSearch (not the variable, but the actual string).  That, of course,
>will never equal 0.  Also, it looks like you are trying to reference a
>variable that does not exist in your form (forecast_bycommunity_form).
>Also, you have a hidden form field, "reporttype" that will ALWAYS be 2, so
>even if your conditional statement (the cfif/elseif) would have the
>variables properly specified, you would never get to Total Forecasted
School
>Age Population (5-17) by School District, because reporttype will always
>equal 2.  So even if someone selected that item from your drop down, your
>page would still display the Total Forecasted Employment by Community.
>Lastly, if you are posting to the same page, then you don't need to specify
>the action in <cfform>  You can, of course, but if you are really posting
to
>a different page, then your display code on this page would never be
reached
>anyway.  I'm guessing, but I think this is what you are looking for:
>
><cfform name="forecast_bycommunity_form" method="post" preservedata="yes">
>       
>    <div id="search" style="border:1px solid black; padding:10px;
>width:230px;">
>        Regional Search<br /><br />
>            <cfselect name="RegionalSearch" size="4" style="width:230px">
>                <option value="0">Total population by Community</option>
>                <option value="1">Total households by Community</option>
>                <option value="2">Total employment by Community</option>
>                <option value="3">School age pop. (5-17) by School
>District</option>
>            </cfselect><br /><br />
>        <input type="submit" value="Search Data" id="fbc_submit" />
>    </div>
>  
></cfform>
>
><cfif isDefined("form.RegionalSearch")>
><div class="title" style="width:890px; text-align:center">
>   <cfif form.RegionalSearch EQ 0>
>      Total Forecasted Population by Community
>   <cfelseif form.RegionalSearch EQ 1>
>      Total Forecasted Households by Community
>   <cfelseif form.RegionalSearch EQ 2>
>      Total Forecasted Employment by Community
>   <cfelse>
>      Total Forecasted School Age Population (5-17) by School District
>   </cfif>
></div>
></cfif>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4214
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to