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

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -