ColdFusion 8 Ajax - binding and strings with commas - part 2
Use the download link bellow to download a zip file with a index.cfm and a mycfc.cfc file.
Unzip somewhere under the webroot on a CF8 server and open index.cfm in your web browser.
Now you see a grid which is populated with artists from the cfartgallery db that is installed with CF by default.
There is also a text input field. Type in a single artistID (1) and submit, and the grid will return the one artist with that artistID. Type in more than one in a comma separated list (1,2,3) and submit. Theoretically the grid should return the 3 artists with the submitted artistID's. Instead you'll see the error I was talking about:
Error parsing bind cfc:mycfc.getArtists({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},'1,2')
You cannot specify more arguments to a CFC function than it declares.


Change the input field like so:
<input id="artistIDlist" name="artistIDlist" type="text" value="<cfoutput>#form.artistIDlist#</cfoutput>" />
Then change the bind value from
'#form.artistIDlist#'
to
{artistIDlist}
Make sure to add a cfqueryparam to the back end and some javascript validation to the front to prevent errors, but other than that, it should work correctly for you now.