I have a page with 3 dropdown fields. The 2nd dropdown uses the selection from the first to create the options list and the 3rd dropdown uses the selection in the 2nd to create that list. I'm using CFSelect with the bind option and a function in a CFC file. The page loads fine, I select the item out of the first dropdown and the 2nd dropdown is correctly bound to the data returned. But, I get a browser error that tells me that there was an error executing a database query and that I need to add cfdebug to my url. This isn't an error that halts execution, it's just a little modal where I can click on "Ok" to get rid of it and then when I select an item in the 2nd dropdown, the 3rd dropdown is correctly loaded. The code from both the CFM and CFC files is below.
Is the page trying to bind the 3rd dropdown at the same time as the 2nd? How can I keep from getting that error?
Thanks
DW
Code from CFM file:
<table>
<tr>
<td>Category 1:<br />
<cfselect name="proceduretype1"
query = "Gettoplevel"
display ="proceduretypename"
value ="proceduretypeid"
multiple="no"
size="6" /></td>
<td> </td>
<td>Category 2:<br />
<cfselect name="proceduretype2"
bind="cfc:dynamicdropdown.getnextlevel({proceduretype1})"
bindonload="false"
type="link"
display="proceduretypename"
value="proceduretypeid"
multiple="no"
size="6"/></td>
<td> </td>
<td>Category 3:<br />
<cfselect name="procduretype3"
bind="cfc:dynamicdropdown.getnextlevel({proceduretype2})"
bindonload="false"
type="link"
display="proceduretypename"
value="proceduretypeid"
multiple="no"
size="6"/></td>
Code from CFC file:
<cfcomponent name="dynamicdropdown">
<cffunction name="getnextlevel" access="remote" returntype="query">
<cfargument name="parentid" type="any" required="no">
<!---Define variables--->
<cfset var data="proceduretype">
<!---Run query to get Date Data--->
<cfquery name="data" datasource="cusp_dev">
SELECT *
FROM tblproceduretype
WHERE proceduretypeparent=#ARGUMENTS.parentid#
ORDER BY proceduretypename
</cfquery>
<!---And return it--->
<cfreturn data>
</cffunction>
</cfcomponent>