How to catch reset of a form not before, but right after the event?

Giganews Newsgroups
Subject: How to catch reset of a form not before, but right after the event?
Posted by:  John Smith (som…@microsoft.com)
Date: Wed, 23 Jul 2003

Hello. Can anybody read this and come up with the solution? I would
appreciate any input.

In my form I have two fields (Field1 is select and Field2 is text input).
Field1 has "onchange" event which fires a function which hides or displays
Field2 depending on chosen value of Field1 by means of manipulating style
"display" property setting it to "none" or "inline".

Everything works fine, but only problem is reset button. When Field1 is
reset then onchange for Field1 is not triggered. So, I have a situation when
Field2 is displayed or hidden when it should not be according to value
Field1.

I tried to use "onreset" event to put there the logic of hiding/displaying
of Field2, but this event seems to trigger BEFORE and not right AFTER reset.
So, I don't have reset value of Field1 at that moment.

Thanks
JS

Replies