Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Waiting page while loading

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody!
Could you please tell me if there is a way to do a waiting page while the real one is loaded at all?
You know, when you press a submit button, the message "waiting...." appears while the form is processed and then the second page appear completely.. I mean, something that let the waiting message until the page is completely loaded.
Help me please,
Any clue will be great!
Thanks in advance,
Nancy.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay....here is an idea,,,,i used a button instead of a submit, all you need to do is add the on_click statement to you submit button. Pops up a layer on the page and says it is processing.
This is just a quick idea....see if it works and remember to change on_click to one word by removing the _.
<html>
<head>
<title>Ad</title>
</head>
<body>
<script>
function Advert(){
var wlayer="LoadingAlert";
var how="visible";
if (document.getElementById) {
document.getElementById(wlayer).style.visibility = how;
}
else if (document.all) {
document.all[wlayer].style.visibility = how;
}
else if (document.layers) {
document.layers[wlayer].visibility = how;
}
}
</script>
<div id="LoadingAlert" style="position:absolute;top:200;left:300;visibility:hidden;">
<table border="1" cellpadding="5" cellspacing="0" bordercolor="#006F93" bgcolor="#C0C0C0">
<tr>
<td>
<p align="center"><b><font size="5">Please Wait while the form is processing.<br>
It will take a short moment of your time.<br>
Thank You!</font></b></td>
</tr>
</table>
</div>
<form>
<input type="button" on_click="Advert()" value="show it">
</form>
</body>
</html>
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Al for your reply,
But, unfortunatly, it only works on IE and I need a solution that works either in IE or Netscape.
And it would be great if the first page dissapear (clear) while the message is shown.
Could you please help me?
Or dou you know where I could find clues to help me?
Thanks in advance
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
change the div to something like this
<div id="LoadingAlert" style="position:absolute;top:0;left:0;visibility:hidden;width:100%;height:100%">
<table border='1' bordercolor="#006F93" bgcolor="000000" bgcolor="#C0C0C0" width="100%" height="100%">
<tr><td align="center" valign="middle">
<table border="1" cellpadding="5" cellspacing="0" bordercolor="#006F93" bgcolor="#C0C0C0">
<tr>
<td>
<p align="center"><b><font size="5">Please Wait while the form is processing.<br>
It will take a short moment of your time.<br>
Thank You!</font></b></td>
</tr>
</table>
</td></tr>
</table>
</div>
you may be able to try the following to submit the form....might help with netscape...
<input type="button" on_click="Advert();formname.submit();" value="Submit Form">
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks againg Ian, but it still doesn't work in Netscape.
 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using CGI or Servlets to generate your content then try something like the following in pseudocode:

This solution uses client-pull to periodically check if the content is ready on the server. It is easier with Servlets where the HttpSession object can be used to track if the content is available yet.
HTH, Neil
[ September 26, 2002: Message edited by: Neil Laurance ]
 
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nancy,
the example I have was done using servlets but essentially any server side scripting process could produce it.
The process is done is 3 steps:
1) a page with the form parameters submits to an intermediate page
2) the intermediate page displays a message "please wait" and preforms a JavaScript location.replace to submit the parameters to the page which does the actual work.
3) the "work" page returns a result after a while
The key part is step 2 which only has the responsibility of displaying a message and forwarding the parameters on to the page the does the real work.
Anyway here is the code (listed in 3 servlets), you should be able to see what's going on.
Servlet1 (step1)

Servlet2 (step 2)

Servlet3 (step3)

Hopefully you get the idea, and yes this is browser independent.
James.
[ September 26, 2002: Message edited by: James Swan ]
 
There is no "i" in denial. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic