JQuery, bind same function to 3 different textbox's keyup event

Posted by Miral on Stack Overflow See other posts from Stack Overflow or by Miral
Published on 2009-07-16T14:32:03Z Indexed on 2010/04/02 8:33 UTC
Read the original article Hit count: 373

Filed under:
|
|

I have 3 textboxes and on the keyup event for all the 3 I want to call the same function?

In the below code, I am tring to bind 'keyup' event to 'CalculateTotalOnKeyUpEvent' function to textbox named 'compensation', but it doesn't work

$("#compensation")   
      .bind("keyup",CalculateTotalOnKeyUpEvent(keyupEvent));

function CalculateTotalOnKeyUpEvent(keyupEvent) {
        var keyCode = keyupEvent.keyCode;
        if (KeyStrokeAllowdToCalculateRefund(keyCode)) {
            CalculateTotalRefund();
        }
    };

Thanks..

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about bind