Question

I am trying to use this post in order to get the animated gif for Please wait message.... on button click. However, when I open the sample html page that I am testing on, I get an input box instead of an button with am image.

Below is the html code that I am trying on a test page.

 <html>

 <script type="text/javascript">


  function loadSubmit() {
   var ProgressImage = document.getElementById('progress_image');
  document.getElementById("progress").style.visibility = “visible”;
   setTimeout(function(){ProgressImage.src = ProgressImage.src},100);
   return true;
    }
    </script>

 <body>
   <p style="visibility:hidden;" id="progress">

  <img id="progress_image" style="padding-left:5px;padding-top:5px;" src="ajax-loader.gif" alt=""> Uploading in progress…      </p> 
    <input class="contSubmit" onclick="return loadSubmit()" type=”button” src= "submitinfo_btn.png" /> 

     </body>
   </html>
Was it helpful?

Solution 2

According to your tutorial, the input should be of type "image", not "button".

OTHER TIPS

Be careful when copy-pasting Code like this. This is wrong:

type=”button”

This is right:

type="button"

Notice the difference? This happens if you copy Code from a website that doesn't have proper formatting for Code enabled.

Change your input type to image. The src is only valid for image.

Also, it appears your problem has nothing to do with your "please wait" animated gif, so maybe your title is misleading.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top