how to find whether a value of textbox has changed or not using javascript(even if we copy something and paste it using right click and paste)
A:
Go about something like this:
var elem = document.getElementById('id here');
elem.onchange = function(){
// your code here......
};
More Info:
Sarfraz
2010-06-17 16:56:02
i have made auto grow textarea.it's working fine but when copying and pasting using right click it's not working properly.if i use onchange event in this situation it won't work either because to fire this event we need press enter or tab. please help me to solve this problem.
Niraj Choubey
2010-06-17 17:00:25
A:
if you need to check this on separate event and can't use onchange event, you can compare objects defaultValue and value
jab11
2010-06-17 17:02:34
A:
You can use the onchange event to track if the contents have been changed. It is also possible to compare current input[type=text].value to input[type=text].defaultValue. defaultValue will have the original value supplied in the value-attribute.
nikc
2010-06-17 17:11:07