0

I am building a page with a member login system on the home page. I right now have it so that if the user does not enter a password or username it will change a div to block style and show the error at the top of the page. Is it possible to after 5000 msec after returning false to the form, to hide the div again?

User Does Not Enter Username/Pass
Submit Button Pressed
Error Div Is Shown
Form Results False
5000msec Wait
Error Div Is Hidden

Any and all help is greatly appreciated. I have been trying for a while, but I either have it disappear and the form takes 5 seconds to get its result, or the form returns false and the div does not disappear. Thanks.

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by MartinRinehart
0

Here's a QD function (untested, typos included no extra charge):

function show_briefly( div2show, millis2show_it ) {
    div2show.style.display = 'block'; // make it visible
    function hide() { div2show.style.display = 'none'; }
    setTimeout( hide, millis2show_it );
}

That assumes that your help message is in 'div2show' and that the div is set to 'display: none' via CSS or JS.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.