0
我使用綁定屬性填充cfselect框。我希望能夠從兩個下拉菜單中進行選擇,然後根據該選擇填充CFTEXTAREA。我以爲我可以發出一個類似的綁定屬性命令,但textarea輸出:將數據綁定到CFTEXTAREA
[object Object]
CF8文件說這可能嗎?我錯過了什麼?
表單代碼:
<cfselect name="descriptionDD" value="description" bind="cfc:cfcs.menudata.getData()" bindonload="true" />
<cftextarea name="detailDD" value="service_detail" bind="cfc:cfcs.menudata.getDetail({descriptionDD})" bindonload="true" />
CFC代碼:
<cfcomponent>
<!---First Select Box --->
<cffunction name="getData" access="remote" returntype="query">
<!--- Function to get data from datasource --->
<cfquery name="data" datasource="ezpay">
select description
from service_descriptions
order by description
</cfquery>
<!--- Return results --->
<cfreturn data>
</cffunction>
<!---Second Select Box --->
<cffunction name="getDetail" access="remote" returnType="query">
<cfargument name="description" type="any" required="true">
<cfquery name="dataDetail" datasource="ezpay">
SELECT service_detail
from service_descriptions
WHERE description = '#ARGUMENTS.description#'
ORDER BY ID ASC
</cfquery>
<cfreturn dataDetail>
</cffunction>
</cfcomponent>
你是個天才!!!!!謝謝。 –
確實;我錯了,這是有效的。 –