How can I display a status message while uploading a file?

Is it possible to give a simple method using JavaScript to display a status message when a file is loaded and disappear on file upload?

0


source to share


5 answers


  <style type="text/css">
     #loadingMessage {
        position: absolute;
        top: WHEREVER;
        left: WHEREEVER;
        z-Index: 100;
     }
  </style> 


   <div id="loadingMessage" style="visibility:hidden;">This page be uploading!</div>

    <form id="yourForm"> ... </form>

    <script>
       document.getElementById("yourform").onsubmit = function() {
          document.getElementById("loadingMessage").visibilty = "visible";
          return true;
       };
    </script>

      



+1


source


With jquery plugins you can apply many on-load and post-download effects.

Check out these demo links:
http://valums.com/wp-content/uploads/ajax-upload/demo-prototype.htm
http://www.uploadify.com/demo/



Jquery example:
http://valums.com/ajax-upload/

+1


source


It depends on your server language. If you are using PHP you need something like this: Martin Jansen

0


source


I was in a similar situation a while ago and ended up using the excellent BlockUI for jQuery .

0


source


  <style type="text/css">
     #loadingMessage {
        position: absolute;
        top: WHEREVER;
        left: WHEREEVER;
        z-Index: 100;
     }
  </style>

    <div id="loadingMessage" style="visibility:hidden;">This page be uploading!</div>

    <form id="yourForm"> ... </form>

    <script>
       document.getElementById("yourform").onsubmit = function() {
          document.getElementById("loadingMessage").visibilty = "visible";
          return true;
       };
    </script>

      

0


source







All Articles