Detecting values that have changes on a post back

  • Thread starter Thread starter Simon Harvey
  • Start date Start date
S

Simon Harvey

Hi all,

Is there any easy way to check a field for calues that have changed on a
post back.

So the page is sent to the user, the user changes some values and I need to
know which ones changed.

Is the only way to do this to go through all the fields and check them
against their old values. In which case, would I need to store the values in
the session object so I could tell what the old values were?

This sounds a bit messy so I'm hoping there is some easier way.

Any help would be greatfully received

Thanks everyone

Simon
 
Search on google for "javascript dirty flag", or something similar. Some
sites use an OnChange attribute in the html input fields, and set a
variable for each field indicating whether than field has been altered.

Basically, each field has its own hidden field, with an initial value=0.
Each input field has its own OnChange event that sets its relative hidden
field value to 1. When the form posts back you just check the hidden
fields to see what changed.

It's not a great solution, but sometimes desirable.

--
CharlieN
VSU

This posting is provided "AS IS" with no warranties, and confers no rights.

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
 
Back
Top