T
Taras_96
Hi everyone,
How do you detect that a form element has been changed? This thread:
http://groups.google.com/group/comp...ed+OR+changed)&rnum=28&hl=en#125a82c9be127790
suggests that you attach onChange event handlers to every form element,
and when the handler fires you update a global 'isChanged' variable.
This technique seems to be a bit messy to me (I have many form
elements), I was thinking about storing the original form object in a
javascript variable when the body loads (in the bodie's onLoad event
handler), and upons submission, doing a javascript equality comparison
with the current form object. If nothing has changed, then the two
objects should be equal, right?
if(oldObject == document.getElementById('form'))
{
alert('has changed!');
}
Would this work?
Cheers
Taras
How do you detect that a form element has been changed? This thread:
http://groups.google.com/group/comp...ed+OR+changed)&rnum=28&hl=en#125a82c9be127790
suggests that you attach onChange event handlers to every form element,
and when the handler fires you update a global 'isChanged' variable.
This technique seems to be a bit messy to me (I have many form
elements), I was thinking about storing the original form object in a
javascript variable when the body loads (in the bodie's onLoad event
handler), and upons submission, doing a javascript equality comparison
with the current form object. If nothing has changed, then the two
objects should be equal, right?
if(oldObject == document.getElementById('form'))
{
alert('has changed!');
}
Would this work?
Cheers
Taras