Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading screen

Status
Not open for further replies.

damann

Technical User
Jul 19, 2000
114
0
0
US
Can anyone enlighten me on how to create a loading screen?&nbsp;&nbsp;I want whenever you press a submit button, instead of waiting for the cgi to run a nd spit back your results, a screen pops up saying loading or somehting of that nature so that the user knows that something is going on and that it's not timing out.<br><br><br>I hope someone understands this...<br><br>HELP....
 
Javascript is the only way I can think of doing it. Either an alert box the user closes, or maybe creating a new document and loading some HTML code into it saying &quot;Loading&quot; etc...<br><br>Then an event onLoad event set up in the page created by the CGI to close the window again?<br><br>So you have: <br><br>onSubmit on your main page linked to a function that creates a new window and HTML document inside saying &quot;Loading...&quot;<br><br>An onLoad event on the page being created by your CGI script which closes the loading window.<br><br>If you didn't want a new window you could possibly reload the existing one with the &quot;loading.&quot; message screen and then replace that with your CGI-Generated code...<br><br>Not sure how to actually write any of that though!<br><br>Hope it helped<br>Loon
 
So there's no other way to do this in Perl?&nbsp;&nbsp;I am having a hard time doing this with javascript...&nbsp;&nbsp;Cause I dont konw know javaScript too well...<br><br>
 
Damann,<br><br>&nbsp;&nbsp;&nbsp;here goes... :)<br><br><FONT FACE=monospace>&lt;html&gt;<br>&lt;head&gt;<br>&lt;script language=&quot;JavaScript&quot;&gt;<br>&lt;!--<br>var load_msg = &quot;Loading, please wait...&quot;;<br>//--&gt;<br>&lt;/script&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;form method=get action=&quot;yourPerlScript.pl&quot; onSubmit=&quot;document.write(load_msg);&quot;&gt;<br>Form stuff..... if you want it and then....<br>&lt;p&gt;<br>&lt;input type=&quot;submit&quot; value=&quot;click me!&quot; name=&quot;form1&quot;&gt;<br>&lt;/form&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</font><br><br>I think that might do it, I am not sure if the onSubmit event will take precedence over the script getting run as I've never tried anything like this but it should give you a starting point. I gave it a quick test and although the script was started and didn't exist hence I got an error page straight away, when I did a BACK on my browser the message was there. Let me know how you get on!<br><br>Hope that helped<br>Loon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top