close page automiatically at redirection

  • TatsfieldPC
    Asked on February 19, 2016 at 7:57 AM
  • beril JotForm UI Developer
    Replied on February 19, 2016 at 10:59 AM

    As far as I understand from your thread you want to close your window after submission.

    To do that, you can add the JavaScript code:

    var inFormOrLink;

    $('a').on('click', function() { inFormOrLink = true; });

    $('form').on('submit', function() { inFormOrLink = true; });

     

    $(window).on("beforeunload", function() { 

        return inFormOrLink ? "Do you really want to close?" : null

    })

     

    For jQuery versions older than 1.7, try this:

     

    var inFormOrLink;

    $('a').live('click', function() { inFormOrLink = true; });

    $('form').bind('submit', function() { inFormOrLink = true; });

     

    $(window).bind("beforeunload", function() { 

        return inFormOrLink ? "Do you really want to close?" : null

     

    })

     

    http://stackoverflow.com/questions/1631959/how-to-capture-the-browser-window-close-event?lq=1

    However, please note that you need to download the full source code of your form if you want to add javascript code.

    http://www.jotform.com/help/104-How-to-get-your-Form-Source-Code

    If it doesn't your answer, please provide us more details. We will be glad to assist you.