Form

How to detect if fields in form are changed or not?

Method 1 (JS)

  • Use hidden text box to store the initial value, then compare initial value with current value

Method 2 (ASP.NET – Server Side)

  • Store the original values in ViewState, compare each value when you are back on server

Method 3 (JS)

  • Add “onChange” attribute to the controls

How to create a “Reset” button, which clear all unsaved values and show back all saved values?

Method 1 (Server access needed)

  • Call DB again and re-fill all fields

Method 2 (Client access only)

  • Save all values into hidden fields
  • When “Reset” button is clicked, re-fill all fields by these hidden fields

Be the first to comment

Leave a Reply

Your email address will not be published.


*