Is there is any way to detect text box value changed , whether users changes it explicitly or some java script code modified the text box? I need to detect this change.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To track for user changes you can add a handler for key presses:
Update: besides watching for key presses,
. It won’t work immediatly for user changes (is only called after the input loses focus), but together with theyou can use the
changefunction to watch from changes via JavaScriptkeypressI believe you cover all cases:Edit: sorry, it seemed to work for JavaScript too, but I was mistaken… This question, however, will be able to solve your problem (tested with
setTimeout, and it was able to detect the change).I posted an example in jsFiddle. With this new
watchplugin, you no longer needkeypressorchange: it will work for key typing, copy/pasting, JavaScript, etc.