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

274
Views
How to redirect to another page after form submition using a loading screen
<form action='page.html' 
method='post'>
<input type="text" name="name" placeholder="Enter your name here"> 
<input type="submit" value="submit">
</form>

In this above code after form submition there will be about 5 seconds of a loading screen or a icon(icon is better), then it will redirect to page.html.I am new to Web Dev world, so please help me anyone with the coding part. I don't know how to do it using javascript or jQuery.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can use font awesome spinner icon, this code will display a spinner icon below the input field for 5 seconds. You can change its place depending on your needs.

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>

<form action='page.html' method='post' onSubmit="return showSpinner(this);">
<input type="text" name="name" placeholder="Enter your name here"> 
<input type="submit" value="submit">
</form>
<i class="fa fa-spinner fa-pulse" style="font-size:24px;visibility:hidden" id="spinner-icon"></i>

<script>
    const showSpinner = form => {
        // Display the spinner icon
        document.getElementById("spinner-icon").style.visibility = "visible";
        // Wait 5 seconds then submit form
        setTimeout(function() {
            form.submit();
        }, 5000);  // 5 seconds
        
        return false;
    }
</script>
</body>
</html>
about 4 years ago · Juan Pablo Isaza Report

0

<form action='page.html' method='post' onsubmit="myFunction()">
<input type="text" name="name" placeholder="Enter your name here"> 
<input type="submit" value="submit">
</form>

<script>
function myFunction() {
  alert("The form was submitted");
}
</script>
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!