html - Simple indication that file is uploading after pressing Submit -


i'm looking simple way show file being uploaded after submit button pressed. files can 50 mb in size , users can think browser has frozen because takes long time. i'm not looking animated, word loading... appears next (or in place of) submit button. onclick might i'm not sure if interfere submit process.

display "spinning gif" right next submit button made visible on onsubmit event. redirect form new page or reload current page when form done uploading.

here's simple example:

<script>     $(".spinner").hide();      function loadspinner() {          $(".spinner").show();           //do validations                        //redirect     }  </script> 

the form this:

< form onsubmit="loadspinner()">     .     .     .     <div>         <input id="submitbutton" type="submit" />          <span class="spinner"><img src="images/loading.gif" /></span>     </div>  </form> 

this example assumes you're using jquery.


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -