View Single Post
  #55  
Old 02-21-2008, 02:05 AM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,264
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Thumbs up ColdFusion Tips & Tricks - Using the Javascript "onChange" function in a CFSELECT fi

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>
__________________
Prasanna Vignesh
MCPD | Web Developer
Reply With Quote