Hi, I have a input box where I would like to call a() on keypress event and call b() in blur event. How do i do that?.
The second event it's easy to set: onBlur="b();". For the first, you should be aware that key capturing is document-wide - I belive there are some other solutions, but if you want cross-browser compatibility there's no way around. Being document-wide, you will need to combine the keycapturing with the focus events of the input box so you will be capturing only then the input is done in that particular box. For implementation, read this and this. Good luck!