ColdBox3.8.0/CF10 - Checkbox Processing



<input type=“checkbox” class=“filterCheck” name=“IT” onlick="#event.buildLink(‘SearchController.searchFilters’)#?IT=#rc.IT#" <cfif NOT structKeyExists(form,‘fieldnames’) OR structKeyExists(form,‘IT’)>checked=“checked” > Yes (#rc.ITSystems.RecordCount#)


When I clicked in the checkbox, the check appears, but no action took place. Am I doing something wrong with the code above?

Thank you!



**should be onClick=""**


**you'll have to handle the event with javascript.**

**look at the rendered output.**

Is there a reason why the event cannot be handle by the handler? I wanted to use the cold fusion data model…and not via JavaScript

i see. cfform might wrap up all that js for you.

from your example, it looks like it would render onClick="?event=my.event". that wouldnt do anything.

perhaps its rendering differently. is that so?

CFML is server-side. HTML/JavaScript is client-side. Once your CFML engine does its rendering, it is done and out of the picture. You cannot execute CFML from a browser event, because the browser is client-side and CFML is uninvolved. JavaScript is required in order to act upon a click, etc.