Results 1 to 3 of 3

Thread: Detecting if form input fields have been edited

Hybrid View

  1. #1
    Join Date
    Apr 2005
    Location
    Austria
    Posts
    1

    Default Detecting if form input fields have been edited

    Hello.

    In our project we are using the spring framework and I are quite happy about our choice. Everything works fine but there is one question and I am wondering if anyone knows an answer to the following:

    Is there a way to make our application notice if the user edited the fields of an input form? For e.g. we have an input form with about 5 input fields which is bound to a related object. Is it possible to tell our application that there is/was an edit?

    Thank you very much for your anticipation.

    Wolfgang

  2. #2
    Join Date
    Oct 2004
    Location
    Herndon, VA, US
    Posts
    648

    Default

    One way is obviously to take a snapshot of the form object before showing the form, then compare it field by field with the form object binded from the form submission.

    Another way is to have some javascript on the client side listening to appropriate events (e.g. onchange), and setting a hidden field if it detects any changes.
    --Jing Xue

  3. #3

    Default

    We use the latter approach (JavaScript). Please note that there are some catches or the JavaScript thinks the page has been changed, for example I believe your dropdown fields must have default values (we make sure this is the case by embedding this in a velocity macro for a select input field that takes the first value as default if there is no other default).

Similar Threads

  1. Replies: 3
    Last Post: Jun 8th, 2010, 03:27 AM
  2. Replies: 6
    Last Post: Sep 24th, 2006, 11:58 AM
  3. Replies: 2
    Last Post: Aug 4th, 2006, 01:37 PM
  4. Replies: 1
    Last Post: Sep 22nd, 2005, 04:42 AM
  5. Submission of empty form fields
    By steven.warren in forum Web
    Replies: 7
    Last Post: Aug 17th, 2004, 03:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •