nonphoto nonphoto - 2 years ago 99
Javascript Question

Prevent input event from firing when changing textarea programmatically

I have a

that can be edited by the user. I occasionally update the text programmatically by changing the element's
property. I need an event that triggers when the user changes the text, but not when the program changes it. Is this possible?

Answer Source

use keyup as the event trigger which will allow the user activity to trigger the function but not if you do it programmatically

addEvent(document.getElementById('textArea_id'), 'keyup', function(event) {
//function goes here
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download