Link to home
Start Free TrialLog in
Avatar of TrialUser
TrialUserFlag for Afghanistan

asked on

hide a label on a timer

When user clicks submit button I display a message like "Changes saved succefsully". I would like this to be :
1) either gone after 3 seconds
or
2) when the user clicks on submit again, on client side before post back happens, I want this label to be hidden (so that when the error message shows on a required field validator the success messgae is still not visible from previous click. Please help. Thanks
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

after displaying the message
setTimeout("hideMessage()", 3000);


function hideMessage()
{
   //code to hide the message
}
ASKER CERTIFIED SOLUTION
Avatar of Ramkisan Jagtap
Ramkisan Jagtap
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
see the code below using jquery:

jquery reference:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
$("#<%= button.ClientID %>").click(function() {
window.setInterval(clear, 3000);
});

function clear() {
$("#<%= lbl.ClientID %>").text("");
}

Open in new window

Avatar of TrialUser

ASKER

thx