Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
How to show a "please wait" message to a user after form submits in HTML

I'd like to show a "please wait" message to the user after hitting "submit" on a form. For now I've managed to at least disable the button after the user clicks it, but how can I display a "please wait" message / modal while the next page loads?

This is my code:

<input class="btn btn-primary btn-md" id="submit" name="submit" type="submit" value="Next">
$('form').submit(function(){
   $(this).children('input[type=submit]').prop('disabled', true);
 });
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

For this answer, I have provided a hidden <div> with the "Please Wait" text. This could be any HTML in any style you want. When the button is clicked, the wait message is displayed and the submit button is disabled. Since this does not wait for the UI changes to happen, it is possible that the form will submit before the user sees the Please Wait message.

$('form').submit(function(){
  $('#waiting').show();
  $(this).children('input[type=submit]').prop('disabled', true);
 });
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form id="form">
  <div>Please submit the form</div>
  <input class="btn btn-primary btn-md" id="submit" name="submit" type="submit" value="Next">
</form>
<div id="waiting" style="display:none">Please wait...</div>

about 4 years ago · Juan Pablo Isaza Report

0

You can create a div styled with display: none; and then you show it while triggering the submission.

<div style="display: none;" id="please_wait" class="text-center">
    <p>Please Wait...</p>
</div>
$('form').submit(function (e) { 
    $(this).children('input[type=submit]').prop('disabled', true);
    $('#please_wait').show();
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!