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 6926941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:59:01+00:00 2026-05-27T10:59:01+00:00

Basically the same functionality as stackoverflow when posting a question, if you start writing

  • 0

Basically the same functionality as stackoverflow when posting a question, if you start writing a post then try to reload the page. You get a javascript alert box warning message.

I understand how to check if the form has been changed, although how do I do the next step.

I.E: How to I check this when leaving the page, on here you get “This page is asking you to confirm that you want to leave – data you have entered may not be saved.”?

EDIT: found correct answer here to another question https://stackoverflow.com/a/2366024/560287

  • 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-27T10:59:02+00:00Added an answer on May 27, 2026 at 10:59 am

    I’m very sure that if you search, ‘jQuery detect form change plugin’, you will find something much more usable than this semi-pseudo code i’m about to write:

    formChanged = function(form) {
        form.find('input[type="text"], textarea').each(function(elem) {
            if (elem.defaultValue != elem.value) {
                return true;
            }
        });
        // repeat for checkbox/radio: .defaultChecked
        // repeat for ddl/listbox: .defaultSelected
        return false;
    }
    

    usage:

    if (formChanged($('form')) { // do something }
    

    Note that this is to detect changes against the original rendered value. For instance, if a textbox has a value = “x”, and the user changes it to “y”, then changes it back to “x”; this will detect it as NO change.

    If you do not care about this scenario, you can just do this:

    window.formChanged = false;
    
    $(':input').change(function() {
        window.formChanged = true;
    });
    

    Then you can just check that value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is basically the same question as Click items in select box, and then
I'm writing an application which has two classes that provide basically the same functionality
I have basically the same problem outlined in this question, however I am using
I got two gridviews in the same page, which basically displays the same type
Basically my question is the exact same one as this: Simple client/server, TCP/IP encrypting
I'm basically just posting tonight to get some feedback from some of you more
I basically want the same functionality of preg_match_all() from PHP in a Python way.
I'm seeing basically the same issue described here I have a table that starts
I've got some VB code (actually VBA) which is basically the same except for
Is it possible to set the stack limit in DevC++? Basically the same as

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.