Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 234783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:12:46+00:00 2026-05-11T20:12:46+00:00

I have a tabbed html form. Upon navigating from one tab to the other,

  • 0

I have a tabbed html form. Upon navigating from one tab to the other, the current tab’s data is persisted (on the DB) even if there is no change to the data.

I would like to make the persistence call only if the form is edited. The form can contain any kind of control. Dirtying the form need not be by typing some text but choosing a date in a calendar control would also qualify.

One way to achieve this would be to display the form in read-only mode by default and have an ‘Edit’ button and if the user clicks the edit button then the call to DB is made (once again, irrespective of whether data is modified. This is a better improvement to what is currently existing).

I would like to know how to write a generic javascript function that would check if any of the controls value has been modified ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:12:46+00:00Added an answer on May 11, 2026 at 8:12 pm

    In pure javascript, this would not be an easy task, but jQuery makes it very easy to do:

    $("#myform :input").change(function() {
       $("#myform").data("changed",true);
    });
    

    Then before saving, you can check if it was changed:

    if ($("#myform").data("changed")) {
       // submit the form
    }
    

    In the example above, the form has an id equal to “myform”.

    If you need this in many forms, you can easily turn it into a plugin:

    $.fn.extend({
     trackChanges: function() {
       $(":input",this).change(function() {
          $(this.form).data("changed", true);
       });
     }
     ,
     isChanged: function() { 
       return this.data("changed"); 
     }
    });
    

    Then you can simply say:

    $("#myform").trackChanges();
    

    and check if a form has changed:

    if ($("#myform").isChanged()) {
       // ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 244k
  • Answers 244k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer select dbms_mview.get_ddl('TABLE',USER,'TEAMS') from dual; May 13, 2026 at 7:58 am
  • Editorial Team
    Editorial Team added an answer CString has lots of internal tricks which make it look… May 13, 2026 at 7:58 am
  • Editorial Team
    Editorial Team added an answer Linq to Sql only translates certain method calls to SQL,… May 13, 2026 at 7:58 am

Related Questions

I have a website laid out in tables. (a long mortgage form) in each
I have created a tabbed display with html/css. I simply want to use jQuery
I have a third-party app that creates HTML-based reports that I need to display.
I have a small tabbed navigation setup using CSS. When hovering over the tabs

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.