Posts: 65
Location: san francisco, ca
|
Client has a form that once posted will load another page containing a confirmation number to the end-user.
The DB side isnt built yet, wont be for some time maybe, and wont be by me.
Client states that in the worst case, it might be "8-10 seconds" before the DB can load that confirmation page. Thus, he wants feeback for the user regarding 'please wait' and a spinning graphic (indeterminate progress meter)
i've decided to prototype the delay for the client, showing him not only the spinning please wait graphic, but an 8-10 second delay in loading the confirmation page.
For the spinner, i have an onclick event on the submit button, swapping classes on a DIV containing the graphic (display:none > display:block).
so now it seems all i need to do to complete the prototype is to delay the other onclick event on that button, which is to load the confirmation page.
Here is a sample of what is NOT working. This does not include the code with swap classes. I want to get the delay/interval working first.
I could put the URL to go to up in my function. But was trying to nest it all in my onclick event.
IN THE HEAD
Code:
<SCRIPT LANGUAGE="JavaScript">
function PleaseWait()
{
setTimeout("PleaseWait()", 8000);
}
</SCRIPT>
IN THE HTML
Code:
<button name="Submit" onclick="PleaseWait('parent.location='http://www.google.com')">Submit</button>
|