GinsBabu Posted January 5, 2010 Share Posted January 5, 2010 Hi, In my form i have a button which calls a js function to do some action.After the action a message shows.I want to know how can i hide the div if the message has been shown for 10 second.Any help? Quote Link to comment Share on other sites More sharing options...
corbin Posted January 5, 2010 Share Posted January 5, 2010 Look into setTimeout. setTimeout('functionThatHidesDiv()', 10000); Quote Link to comment Share on other sites More sharing options...
GinsBabu Posted January 5, 2010 Author Share Posted January 5, 2010 Hi.. Thanks for the reply .... well i was working on that but had some problem..... my code have a div tag like this.. <div id="d" style="display:inline"> <?php echo $this->message;?> </div> and the js function sendStatusReport(){ document.listclientchoosen.action = "<?php echo $this->baseUrl;?>/admin/clientexports/report"; document.listclientchoosen.submit(); setTimeout("toggle()", 8000 ); } function toggle() { var ele = document.getElementById("d"); ele.style.display = "none"; } Wat am i doing wrong....??also the action performing inside the sendstatusreport() is mail sending.So it may took 8s or 10 s or 15 s.How can excatly point out the time. 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.