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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.