Using the Javascript "onChange" function in a CFSELECT field
If you are using a version of Cold Fusion that will not allow you to pass additional parameters to the form field, you can use this method to trick Cold Fusion into the onChange be displayed. Note that this only work if you are not using any Cold Fusion form field validation.
See the attached code. Note that I did not put any closing quotes at the end of the onChange call - Cold Fusion will do that thinking it's still part of the name attribute.
Example HTML/CFML code: Code:
<CFSET tmp="usercode#Chr(34)# onChange=#Chr(34)#pushForm()">
<cfselect name="#tmp#"
query="staff"
value="staffid"
display="name"
selected="0"
class="textblue">
</cfselect>