input’s difficult event handle

Posted: March 16, 2011 in ECMAScript
Tags:

When user drag and drops the text directly into the Input control, the onkeyup event is not fired as no keyboard is involved.
You can use onfocus event to fix the problem. Like this:

function processInput() {
  // your logic
};
var $element = document.getElementById('elementid');
$element.onfocus = $element.onkeyup = processInput;

also you should use input event in firefox and chrome

How to detect right mouse click + paste using JavaScript?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s