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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:02:53+00:00 2026-05-20T18:02:53+00:00

On submit of a form I show a blocking message Please wait with following

  • 0

On submit of a form I show a blocking message “Please wait” with following code:

$(document).ready(function() { 
  $('form').submit(function() {
    $.blockUI({ message: "<h1 id='waitingmessage'>Plz wait ...</h1>" });
  });
}); 

That works ok for me.

If the user presses F5 now, the browser ask for resubmit. The user is allowed to.
But the script above does not trigger anymore.

How can I trigger this resubmit with jquery, thus the waitingmessage is still shown?

Thx

Chris

EDIT:
The submit of the form goes to the same adress as the form. I only distinct on the controller side between GET and POST. If it was a POST, I process the received data, otherwise I show only the blank form.
The user is allowed to send data twice or as often as wanted. So after the first POST the user can press F5 to resubmit the data, and he is totally allowed to.
It’s just that the waitingmessage does not appear any more.
So I need maybe a more general solution “onpost”. Does something like that exist?

SOLUTION:

$(document).ready(function() { 
   $('form').submit(function() {
      $.blockUI({ message: "<h1 id='waitingmessage'>Bitte warten ...</h1>" });
   });

   $(window).keydown(function(event){
      if (event.keyCode == '116' && '${request.method}' == 'POST') {
         $.blockUI({ message: "<h1 id='waitingmessage'>Bitte warten ...</h1>" });
      }
   });
});

And request.method is set server side and is either ‘GET’ or ‘POST’ thus I know where the user came from.

  • 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-20T18:02:54+00:00Added an answer on May 20, 2026 at 6:02 pm

    It seems that I don’t have perfect solution too. I will do only for only first F5 event

    <script type="text/javascript">
    $(function ()
    {
        $(window).keydown(function (e)
        {
    
            if(e.keyCode == 116){
                submitform();
                return false;
            }
            alert(e.keyCode);
        });
    })
    
    function submitform()
    {
        alert("hello");
    }
    </script>
    
    <form id="myform" action='test.php'>
        <input id="submit" type="submit" onclick="submitform(); return false;"/>
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I submit my form, the last function I have is: $(#message).show().delay(5000).fadeOut(); This will
I have trouble getting a flash message to show after a failed form submit.
I'm using the document.form.submit() function for a rather large input form (hundreds of fields,
$('#post_form').submit(function() { $(#ajax_bar_loader).show(); $.ajax({ url: 'add.html', data: $('#post_form').serialize(), dataType: 'json', type: 'post', success: function(
I got this code in my submit form <form id=myform action='hello.php' method='GET'> <input type=button
$('form').submit(function(){ this.action=http://www.sitename.com/post; return false; }); having altered the action attribute of the form ,i
I'm trying to stop a submit form with Javascript/jQuery, with a: $('form#checkRepair').submit(function() { return
i want after i've been submit form it can show hit counter.. but i
i have one submit form. i want if someone submit same data can show
I have a jquery Ajax call function that I use to submit form to

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.