I have an taxonomy vacabulury with terms. On content creating/editing page terms are shown as checkboxes. I want to add event "onclick" to some checkboxes. How do I can to do this.

Comments

codekarate’s picture

If you want to add a Javascript event handler you will need to add Javascript using one of the below methods:

You can then add your javascript to the necessary pages to add the event handler you need.

Shane Thomas
http://codekarate.com

psy11’s picture

Problem is not in script adding. I added script with drupal_add_js() in theme template.php. I don't know how and where to add event handler

codekarate’s picture

Here is a very basic example I put together.

Drupal.behaviors.whatever = function(context) {

  $('.my-class .form-radio').click(function() {
    //handle my onclick event
  });

}

Shane Thomas
http://codekarate.com