• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 462
  • Last Modified:

Page Loading message to popup?

Hi all,

I have an ASP page that has a form and a submit button for going out to the database for specific date information on records.  This form post the info into the same page, and takes as much as 2-3 minutes to load the data.

I want to have a popup to tell the user that the information is loading.  I would like this popup to be enabled only if the submit button is pressed, and to go away when the page has completed loading.

I don't want to reinvent the wheel, so can someone share their code for this with me.
I would be very grateful.

Cheers,
Sue
0
aspsue
Asked:
aspsue
1 Solution
 
YZlatCommented:
<html>
<head>
<script language="JavaScript">

<!--//

function new_window(url) {

      link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=500,left=40,top=50");

}

//-->
</script>
</head>
<body>

<input type="submit" name="submit1" onClick="javascript:new_window('wait.asp' )">
</body>
</html>

Also create another page called wait.asp with a line "Wait while the page is loading"
0
 
kblack15217Commented:
Unfortunately, this isnt as easy as it sounds.   The solution above will not work for numerous reasons.   The most important reason is that the submit button above is not on any form, and therefore will not submit a form.   Even if there was a form, the window would pop up and not go away after processing is done, since processing is on the server and the pop up is on the client.   in other words, the method above could let the user know that the operation would take time, but thats it.

There are many ways to do what you want:   The most straightforward way involves remote scripting.   Your javascript code would have to open the wait window, then call a remote asp script to process your data, then close the window and update the page with your results.

There is too much detail to explain in this forum, but this link can help:
http://www.devarticles.com/art/1/99

Otherwise, you will just have to live with a message that alerts the user that the processing will take awhile.  YOu can do this with
<input type="submit" name="submit1" onClick="alert('your message');">

within your form.
 
       

0
 
tonydspaniardCommented:
Hi there,
You can workaround too by having two frames.. the one on top (0 pixels height - that is, not visible) could process the server data or submission from bottom frame.. when this occurs, a javascript code could display a message or an animated image with its simple document.write function (this will clear screen).. to give some feedback to the user.. then... when the top frame finished server processing.. a simple onload=parent.close() function will close the pop-up window...

hope this helps

Good luck
0
 
vnvkCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    PAQ - no points refunded

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

vnvk
EE Cleanup Volunteer
0
 
moduloCommented:
PAQed - no points refunded (of 50)

modulo
Community Support Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now