views:

220

answers:

2

Hi all,

I have a webform with around 20 textboxes/drop down list controls and i would like a clean and simple way of checking to see if the form fields have changed or not. Does anyone know of a clean way to do this?

Thanks in advance!

+1  A: 

onkeypress / onkeydown / onkeyup methods in javascript. Are able to monitor keystrokes aimed at the inputs.

If there was a keystroke on the input there will probably be a change.

example

Mischa Kroon
+1  A: 

The easiest way is to loop through the controls collection and then check the TextChanged property.

Note that controls in the collection may have their own controls, so you'll have to do a recursive check.

Chris Lively