Forum Moderators: open
How can I detect if a user has changed a form field without putting javascript in the form field tag?
I could normally use an onChange or keyUp on the tag but I can not do that in this case. Is there a way of detecting a change to its value without using these methods.
What I am looking for is something like this which will obviously not work because I made it up on the spot.
if ( document.forms.theForm.theField.changed == true ) {
document.write('Ive changed');
}
I am not too hot with javascript as you can probably tell but if anyone knows a way of doing this or even just a point in the right direction.
var textBox1 = "original value";
var textBox2 = "original value";
var textBox3 = "original value";
function is_it_different(){
if (document.theForm.theTextBox1.value!= textBox1){
document.write "ive changed";
}
//and so on for all three
}
would this work for you?