CFSELECT - Binding to two fields?
I've got a simple form with three selects. Make, Model and Year.
Model is bound to Make using:
bind="cfc:getdata.getmodels({make@click})"
bindonload="true"
This works great.
Now, I need to have two fields for makes. I'm trying to do something like this (in my own fake coding words):
<select name="make1" class="input">
<option value="" selected>Please Select... </option>
<option value="red">Red</option>
<option value="Blue">Blue</option>
</select>
<select name="make2" class="input">
<option value="" selected>Please Select... </option>
<option value="white">White</option>
<option value="black">Black</option>
</select>
<cfselect name="model" id="model"
value="model"
display="model"
bind="cfc:getdata.getmodels({make@click}) or ({make2@click})"
class="input"
multiple="no"
bindonload="true" />
Essentially which ever Make field is chosen is what Model would bind to.I've tried a number of things, even usinig @311770 with no luck. Is this even possible? I also might have a problem with my CFC:
<!--- Get model by make name --->
<cffunction name="getmodels" access="remote" returnType="query">
<cfargument name="make1" type="string" required="true">
<cfargument name="make2" type="string" required="true">
<!--- Define variables --->
<cfset var data="">
<cfif ARGUMENTS.make1 is not "">
<!--- Get data --->
<cfquery name="data" datasource="dsn" >
SELECT distinct model
FROM dataone09
WHERE make = <cfqueryPARAM value = "#ARGUMENTS.make1#"
CFSQLType = "CF_SQL_VARCHAR">
ORDER BY model
</cfquery>
</cfif>
<cfif ARGUMENTS.make2 is not "">
<!--- Get data --->
<cfquery name="data" datasource="dsn" >
SELECT distinct model
FROM datatwo09
WHERE make = <cfqueryPARAM value = "#ARGUMENTS.make2#"
CFSQLType = "CF_SQL_VARCHAR">
ORDER BY model
</cfquery>
</cfif>
<!--- And return it --->
<cfreturn data>
</cffunction>
Any words of wisdom or guidance would be most helpful,
Thanks!
