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

  • SEARCH
  • Home
  • 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

Related Questions

I have a tabbed series of grids on a data preview page. I now
What i have is a tabbed page with 12 tabs (every tab is a
I have a webpage which has tab list, the HTML looks like this for
I have created a tabbed display with html/css. I simply want to use jQuery
I have a jQuery tabbed search script that gets content from a PHP file
I have some CSS and HTML that are as follows. There's a javascript code
I have a tabbed application and when I click on the second tab, an
I have some html/jQuery that I am using to implement some tabbed navigation. When
Is there a way that I can have a tabbed application, where if i
I have a tabbed menu system and on tab click loads a specific page

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.