EasyUI Forum
May 06, 2024, 07:10:43 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Checkbox click event  (Read 775 times)
galcott
Newbie
*
Posts: 39


View Profile
« on: December 27, 2022, 08:37:03 AM »

I want to run some code when a checkbox is clicked, but I don't want to use the onChange event because that is triggered when the checkbox state is changed programatically. I want it to execute only when clicked by the user.

I tried this code to bind to the click event:
Code:
$('#chkCanceled').checkbox('checkbox').bind('click', (function(e) { CalculateSpecialCharge() }));

But that produced the error message $.fn.checkbox.methods[_53a] is not a function

So is there a way to set a click event on the checkbox?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: December 29, 2022, 06:27:54 AM »

Please try this code instead.
Code:
$('#chkCanceled').next().on('click', function(e){
...
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!