scarhand Posted March 8, 2009 Share Posted March 8, 2009 I want to display an animated gif below a submit button onclick. I can get the image to display fine, but it is not animated in both browsers. This code works in FF but not IE by toggling the display style of the div from "none" to "block": <form method="post"> <input name="submit" type="submit" value="Add domain" onclick="document.getElementById('working').style.display='block'"> <div id="working" style="display: none; margin-top: 2px;"><img src="images/working.gif" style="vertical-align: middle;"> Please wait while the connection is tested</div> </form> This code works in IE but not FF by redrawing the image using innerHTML: <form method="post"> <input name="submit" type="submit" value="Add domain" onclick="document.getElementById('working').innerHTML='<img src=\'images/working.gif\' style=\'vertical-align: middle;\'> Please wait while the connection is tested'"> <div id="working" style="margin-top: 2px;"> </div> </form> I can't get this simple thing to work in both browsers. Its one or the other, and its beyong frustrating. Quote Link to comment Share on other sites More sharing options...
scarhand Posted March 9, 2009 Author Share Posted March 9, 2009 nevermind i just created a conditional browser check using javascript and used both codes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.