Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make lable visible for 10 seconds

Status
Not open for further replies.

jjc4779

IS-IT--Management
May 8, 2010
3
US
Hello everyone,

I have a web application that I have written that allows adding new records to a database and updating a database with changes made to an individual record. When I add a record, I have a label called QueryResult in Red that appears in Red like so, "Record 999 has been Added".

I need for this message to appear only briefly and go away after maybe 10 seconds or so. How can this be done using Javascript?

Any help is appreciated.

jjc4779
 
Use setTimeOut.
Code:
setTimeOut("QueryResult.style.display='none';",10000);


Just call setTimeOut, and set the time in milliseconds for it to wait before hiding your label.





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
vancunita,

I am new to JavaScript. Where do you place your coding in the HTML area in the source code? Do I place after the Title?

jjc4779
 
You place it wherever it is you'll call the function that shows your label. Since I don't know how you show your label, I can't tell you where too place the code.





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top