Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Warning When Leaving Unsubmitted Form #25711
    mgoldsm7
    Participant

    Thank you, Ally and katw!

    I was able to get it working with the following code:

    jQuery(function ($) {
    if (location.href == ‘http://mywebsite.com/query-form/’) {
    $(document).ready(function() {
    formmodified=0;
    $(‘form *’).change(function(){
    formmodified=1;
    });
    window.onbeforeunload = confirmExit;
    function confirmExit() {
    if (formmodified == 1) {
    return “New information not saved. Do you wish to leave the page?”;
    }
    }
    $(“.quform-button-submit”).click(function() {
    formmodified = 0;
    });
    });
    }
    });

Viewing 1 post (of 1 total)
Be inspired. © 2025 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy