DelphiFAQ Home Search:

Show an HTML message box that disappears after 2 seconds

 

comments14 comments. Current rating: 3 stars (9 votes). Leave comments and/ or rate it.

Question:

I need to show an HTML message box that disappears after 2 seconds.
It does not need to be a popup window.

Answer:

Simply display a centered HTML table with a button that says 'please click'.
You can also do an automatic redirect after 3 seconds as shown below.
The sample code uses the setTimeout() function which will call the redirecting javascript function after 3000 milliseconds.

<center>
<table border=4 cellspacing=0 cellpadding=20>
<tr><td bgcolor=silver align=center>

<p>The configuration is being updated.</p>
<p>

<form id=frm1 name=frm1 action="main.cgi" method=post>
<input type=hidden name=action value="detail">
<input type=submit id=btnSubmit name=btnSubmit value="Please click to continue or wait 3 seconds" class=input>
</form>
</p>

<script type=text/javascript language="JavaScript">
<!--
function countdown() {
  document.getElementById('frm1').submit();
}

setTimeout("countdown()", 3000);
document.getElementById('btnSubmit').focus();

-->
</script>

</td></tr></table></center>


Comments:

2009-12-08, 07:35:27
anonymous  
hi, can u please give me the code for html message box
2010-01-05, 05:12:17
anonymous  
to check html error program
2017-11-27, 19:53:54
anonymous from Indonesia  
2020-06-23, 08:35:18
Chance from United States  
rating
Hey! I just now precious to inquire if you always cause whatever problems with
hackers? My utmost blog (wordpress) was hacked and I terminated up losing various
weeks of intemperate run owed to no data substitute. Do you make whatever solutions to prevent
hackers?
2020-06-25, 04:51:30
Denisha from Uzbekistan  
rating
2020-07-15, 16:36:54
Brigette from Germany  
rating
viagra suppliers https://viagenupi.com/
2020-07-27, 20:54:16
Bryce  
rating
extra strength tylenol for sale https://tylenol1st.com/
2020-08-16, 23:12:40
Ruthie from Schonenwerd, Switzerland  
rating
walgreens over the counter inhalers https://amstyles.com/
2020-09-07, 17:36:37
Wilbert from Greece  
rating
hydroxychloroquine virus https://chloroquine1st.com/
2020-09-16, 02:28:52
Rose from Ukraine  
rating
buy amoxicilina noscript https://amoxycillin1st.com/
2020-09-17, 01:28:16
Arlette  
rating
happy family store pharmacy viagra https://mymvrc.org/

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: