Jquery is executed in client/browser side, while ColdFusion is executed server side.
I have done a lot of implementations of that using a CFC. You can try to fire a $.get()
request after every select change event.
Lets say I have a component named "myApplication.cfc" saved in mywebsite/cfc
.
myApplication.cfc
<cfcomponent>
<cffunction name="getstateList" access="remote" returntype="string"
returnformat="plain">
<cfargument name="cid" required="no" default="" type="string">
<cfset var stlist = "">
<cfquery name="stlist" datasource="tasks">
SELECT stateCode
FROM state
WHERE cid = <cfqueryparam value="#arguments.cid#"
cfsqltype="cf_sql_varchar">
</cfquery>
<cfreturn stlist.stateCode>
</cffunction>
</cfcomponent>
Where the $.get('mywebsite/cfc/myApplication.cfc?method=getstateList&cid='+yourParam)
. So after that you can use the result and populate your select list.