Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Bind cfinput to cfselect on change in coldfusion 9

Posted on 2010-08-30
1
Medium Priority
?
1,622 Views
Last Modified: 2012-05-10
Hello -

I'm trying to bind a cfinput to a url based on two changing cfselects. I keep getting an error: "Bind failed, element not found: BillToMonth [Enable debugging by adding 'cfdebug' to your URL parameters to see more information]" (I get it for both elements, BillToMonth and MeterNo)

However, I use that specific variable when binding to a cfdiv on the same page. If I assign values and bind on load, then I get the suspected values returned appropriately.

Here's the code:
<cfajaximport tags = "cfdiv,cfgrid,cfform">
<cfset UserInfoCFC=CreateObject("Component","#pathtofunctions#.UserInfo")>
<cfset ChargeInfo=CreateObject("Component","#pathtofunctions#.CompleteInfo")>

<cfset qryUserInfo=UserInfoCFC.functionUserInfo(Session.MM_UserID)>
<cfset qryLastChargeDate=ChargeInfo.functionLastChargeDate(qryUserInfo.SiteID)>
<cfset qryActiveUtilities=ChargeInfo.functionActiveUtilities(qryUserInfo.SiteID)>
<cfset qryBuildings=ChargeInfo.functionSiteBuildings(qryUserInfo.SiteID)>
<cfset qryMeterNumbers=ChargeInfo.functionMeterNumbers(qryUserInfo.SiteID)>

<cfset pageTitle = "Resident Billing -  #qryUserInfo.CommunityName# Bill Entry">


<cftry>
  <cfset dateone = DateFormat(DateAdd("m", 1, "#qryLastChargeDate.MonthEndDate#"),"mm/dd/yyyy")>
  <cfset dateone = #DATEFORMAT(DateAdd("d",-1,DateAdd("m",1,CreateDate(Year(dateone),Month(dateone),1))),"mm/dd/yyyy")#>
  <cfset datetwo = DateFormat(DateAdd("m", 2, "#qryLastChargeDate.MonthEndDate#"),"mm/dd/yyyy")>
  <cfset datetwo = #DATEFORMAT(DateAdd("d",-1,DateAdd("m",1,CreateDate(Year(datetwo),Month(datetwo),1))),"mm/dd/yyyy")#>
  <cfset datethree = DateFormat(DateAdd("m", 3, "#qryLastChargeDate.MonthEndDate#"),"mm/dd/yyyy")>
  <cfset datethree = #DATEFORMAT(DateAdd("d",-1,DateAdd("m",1,CreateDate(Year(datethree),Month(datethree),1))),"mm/dd/yyyy")#>
  <cfset datefour = DateFormat(DateAdd("m", 4, "#qryLastChargeDate.MonthEndDate#"),"mm/dd/yyyy")>
  <cfset datefour = #DATEFORMAT(DateAdd("d",-1,DateAdd("m",1,CreateDate(Year(datefour),Month(datefour),1))),"mm/dd/yyyy")#>
<cfcatch>
  <cfset dateone = DateFormat(#DateAdd("d",-1,DateAdd("m",1,CreateDate(Year(Now()),Month(now())-1,1)))#,"mm/dd/yyyy")>
  <cfset datetwo = DateFormat(#DateAdd("d",-1,DateAdd("m",1,CreateDate(Year(Now()),Month(now()),1)))#,"mm/dd/yyyy")>
  <cfset datethree = DateFormat(#DateAdd("d",-1,DateAdd("m",1,CreateDate(Year(Now()),Month(now())+1,1)))#,"mm/dd/yyyy")>
  <cfset datefour = DateFormat(#DateAdd("d",-1,DateAdd("m",1,CreateDate(Year(Now()),Month(now())+2,1)))#,"mm/dd/yyyy")>

</cfcatch>
</cftry>

<cfoutput>

         <table width="850" border="0" cellspacing="0" cellpadding="0">
            <cfform name="ChargeMonthSelect" action="#request.myself#=#xfa.insertBill#">
            <cfinput type="hidden" name="SiteID" value="#qryUserInfo.SiteID#">
         	<tr>
            	<td rowspan="40" width="150">
                	<cfinclude template="dsp_inc_menu.cfm">
                </td>
            	<td>
                	<table>
            				<tr>
                        		<th align="left">
                                	Select Month for Utility Bill Entry: 
                                </td>
                                <td align="left">
                                	<cfselect name="BillToMonth">
                                    	<option value="#dateformat(dateone,"yyyy-mm-dd")#">#dateone#</option>
                                        <option value="#dateformat(datetwo,"yyyy-mm-dd")#">#datetwo#</option>
                                        <option value="#dateformat(datethree,"yyyy-mm-dd")#">#datethree#</option>
                                        <option value="#dateformat(datefour,"yyyy-mm-dd")#">#datefour#</option>
                                    </cfselect>
                                </td>
                        	</tr>
                            <tr>
                            	<th align="left">
                                	Invoice/Meter Number:
                                </th>
                                <td align="left">
                                	<cfselect name="MeterNo">
                                    	<option value=""></option>
                                    	<cfloop query="qryMeterNumbers">
                                        <option value="#qryMeterNumbers.MeterNo#">#MeterNo#</option>
                                        </cfloop>
                                    </cfselect>
                                </td>
                            </tr>
                    </table>
                </td>
            </tr>
            <tr>
            	<td><br /><br /></td>
            </tr>
            <tr>
            	<td>
                	<table>
                    		<tr>
                        		<th class="bordered">
                                	Utility Type
                                </th>
                                <th class="bordered">
                                	Amount
                                </th>
                                <th class="bordered">
                                	Allocate To:
                                </th>
                        	</tr>
                    	<cfloop query="qryActiveUtilities">
                        <cfinput type="hidden" name="UtilityID#qryActiveUtilities.CurrentRow#" value="#qryActiveUtilities.UtilityID#">
                        <cfinput type="hidden" name="TotalUtilitiesCount" value="#qryActiveUtilities.RecordCount#">
            				<tr>
                        		<td align="left" class="bordered">
                                	#UtilityDesc#
                                </td>
                                <td class="bordered">
                                	<cfinput type="text" name="UtilityTotal#qryActiveUtilities.CurrentRow#" size="8" bind="url:#request.myself#=#xfa.chargeamount#&UtilityID=#UtilityID#&SiteID=#qryUserInfo.SiteID#&meternumber={MeterNo@change}&BillToMonth={BillToMonth@change}" bindonload="yes">
                                </td>
                                <td class="bordered">
                                <cfif #AllocateTo# eq "Community">
                                	Community
                                    <input type="hidden" name="AllocateTo#qryActiveUtilities.CurrentRow#" value="Community" />
                                <cfelse>
                                	<cfselect name="AllocateTo#qryActiveUtilities.CurrentRow#">
                                        <option value="Building">Building</option>
                                        <option value="Community">Community</option>
                                    </cfselect>
                                </cfif>
                                </td>
                        	</tr>
                        </cfloop>
                        	<tr>
                                <td colspan="3" align="center">
                                    <input type = "submit" name = "submit" value = "Add Bill">
                                </td>
                            </tr>
                    </table>
                </td>
                
                </cfform><td>
                	<cfdiv id="chargesEnteredDiv" bindonload="true" bind="url:#request.myself#=#xfa.chargesentered#&monthenddate={BillToMonth@change}">
                    	<h3>Please select a date above</h3>
                    </cfdiv>
                </td>
            </tr>
            
        </table>
</cfoutput> 

Open in new window


Any help is greatly appreciated.

Thanks!
0
Comment
Question by:bruhast
[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
1 Comment
 

Accepted Solution

by:
bruhast earned 0 total points
ID: 33591784
This was resolved by moving my cfform tag outside of the html table tag.
0

Featured Post

Independent Software Vendors: 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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

610 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