title: How to delay input submit button in a few seconds before submit
body: <p>I have a modal that has list of purposes that the student will choose and after clicking confirm it automatically redirect the the success message page,
  Is there a way to delay the  input type submit i want to display to the student 
  what he choose in few seconds and redirect to success message.</p>
  
  <p>Here is the modal form:</p>
  
  <pre><code>&lt;div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"&gt;
  &lt;div class="modal-dialog modal-dialog-centered  modal-notify modal-info modal-sm"role="document"&gt;
  &lt;div class="modal-content"&gt;
              &lt;div class="modal-header  d-flex justify-content-center"&gt;
                   &lt;p class="heading"&gt;Your Purpose ?&lt;/p&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
             &lt;form method="post" action="index111.php"&gt;
  
  &lt;div class="custom-control custom-radio"&gt;
    &lt;input type="radio" class="custom-control-input" id="purpose1" name="purpose" value="Assignment"&gt;
    &lt;label class="custom-control-label" for="purpose1"&gt;Assignment&lt;/label&gt;
  &lt;/div&gt;
  &lt;div class="custom-control custom-radio"&gt;
    &lt;input type="radio" class="custom-control-input" id="purpose2" name="purpose" value="Reading"&gt;
    &lt;label class="custom-control-label" for="purpose2"&gt;Reading&lt;/label&gt;
  &lt;/div&gt;
  &lt;div class="custom-control custom-radio"&gt;
    &lt;input type="radio" class="custom-control-input" id="purpose3" name="purpose" value="Research"&gt;
    &lt;label class="custom-control-label" for="purpose3"&gt;Research&lt;/label&gt;
  &lt;/div&gt;  
              &lt;div class="modal-footer flex-center"&gt;  
  
                  &lt;button type="submit"  name="submit02" id="modal_button" class="btn btn-primary"&gt;Confirm&lt;/button&gt;
              &lt;/div&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is the code in index111.php:</p>
  
  <pre><code>&lt;?php
   session_start();
   include_once ('connection.php');
  if(isset($_POST['submit02']))
  {
  $time=date("H:i:s");
  $purpose = $_POST['purpose'];
  $sql = mysqli_query($conn,"select * from student_att  order by number DESC limit 1");
  while( $row = mysqli_fetch_array($sql)) {
                    $rfid=$row['rfid_num'];
          $InsertSql = "Update student_att set purpose = '$purpose' , timein = '$time' where rfid_num='$rfid' order by number DESC limit 1";
          $res = mysqli_query($conn, $InsertSql);  
              header("location:valid.php");
               }
      }     
  ?&gt;
  </code></pre>
  
  <p>The valid.php is the success message, hope you can help me. thanks</p>