Re: Problem with CFSELECT(s)
oops! my ad! somehow i have totally missed 2 important things!
1) you do have a control named ServiceID on your page (the first select box)
2) this select box allows multiple selections!!!
the latter means that, if several services were selected, the value of
the ServiceID select box is not a number (which is what cf was
compaining about in the first place), but a comma-delimited list of
so, to make things right, return your code to its original state (as in
your original post) and change your getService function to the following:
[basically, you need to allow ServiceID argument to be of ANY type, and
change your "data" query's WHERE clause to look up values in a list]
<cffunction name="getService" access="remote" returnType="array">
<cfargument name="ServiceID" [b]type="any"[/b] required="true">
<!--- Define variables --->
<cfset var data="">
<cfset var result=ArrayNew(2)>
<cfset var i=0>
<!--- Get data --->
<cfquery name="data" datasource="#THIS.dsn#">
SELECT ServiceTypeID, Name
[b]WHERE ServiceID IN (<cfqueryparam cfsqltype="cf_sql_varchar"
ORDER BY ServiceTypeID
<!--- Convert results to array --->
<cfloop index="i" from="1" to="#data.RecordCount#">
<!--- And return it --->
sorry for the confusion caused previously...