Solved

Bind cfinput to cfselect on change in coldfusion 9

Posted on 2010-08-30
1
1,615 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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

717 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