Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>Trouble with Status/Progress Window

Trouble with Status/Progress Window

azstyx
02-03-2005, 09:21 PM
Environment:
CPAN Perl 5.8.4
Solaris 8
use CGI.pm;
JS 1.2

Problem (was posted on Perl forum with no luck):
Need to do the following:
User enters info on form, clicks on submit, a status window opens with warning messages (Javascript displaying neon characters) that a process update is running and not to close window. Then the process finishes, user gets ok message (in same window as where the neon message was displaying)and closes status window.
What I am trying to do is to warn the user a process is running and they must not close the window prematurely, otherwise the process will abort. I am not sure if I am taking the right or smoothest approach to this problem.
Any suggestions on method or how to correct my issue?

I have three modules:
1) auxupd.cgi - (Perl)Creates the HTML for a form with 3 input fields and a submit button.
2) auxupdater.htm - HTML doc that has JavaScript that displays a neon message warning the user not to close the window until the update process has completed. It uses some standard shareware code for printing neon characters.
(Here's what my messages are and this doc (auxupdater.htm has been tested standalone ok):
One moment please, the information is being updated...
Please be patient ...
Wait for Update Completion Message.
DO NOT CLOSE THIS WINDOW!
3) auxupdater.cgi - a Perl module that takes the parms from the form created by auxupd.cgi and updates the appropiate flat csv files. When it finished the update, it should overwrite the window with the neon message with a successful completion message such as "OK, I have updated your info!!!".

The process flow:
1)auxupd.cgi (Perl module) creates small window with 3 fields and submit button. This CGI action (auxupd.cgi)is invoked from another page as:
<a href=http://www.codingforums.com/archive/index.php/"JavaScript:;" onClick="MM_openBrWindow('../cgi-bin/auxupd.cgi','','width=500,height=350')">
Cool! no problem here.

The Submit button should do the following actions:
a) open a new small window (350px x 300px; using auxupdater.htm)which displays the JavaScript neon message, warning the user not to close the window until the process has completed.
b) while the neon message is running, auxupd.cgi must kick off the Perl module that will do the file updates (auxupdater.cgi).

The FORM parms are (Action=auxupdater.cgi, onSubmit= open.window(auxupdater.htm):
Here's the corresponding Perl code:
print $cgi->startform(-method=>'GET', -action=>'auxupdater.cgi',
-onSubmit=>'window.open("/auxupdater.htm",
"", toolbar=no, location=no, directories=no,
status=no, menubar=no, scrollbars=no, resizable=no, width=350, height=300)'
);


The issue:
My HTML doc with the neon message (auxupdater.htm) is not getting displayed, the process jumps to auxupdater.cgi
immediately and I get the message "OK, I have updated your info!!!" as the next screen. Furthermore, this dislayed text is overwriting the window with the three fields and the submit button. It appears that the open.wondow(auxupdater.htm) never fires.

Any suggestions on how to correct this or re-architect this???
Thanks Team!!!!

Willy Duitt
02-06-2005, 05:09 PM
I would say your problem is right here in the form action and onsubmit event...

The FORM parms are (Action=auxupdater.cgi, onSubmit= open.window(auxupdater.htm):

From what I see there is nothing in the onsubmit event to cancel the action of the form so the form will immediately submit too: auxupdater.cgi

It's hard to say how to deal with this situation without more information but I would think I would approach this problem by submitting to the perl script and having the perl script pop the alert, while continueing to poll the server until the update is complete and then auto-close the popup and transfer or update the parent from there... In other words... I believe your solution lies in how your cgi script handles the form submit...

......Willy


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

can not call click() in Firefox or Mozilla
tool tips, alt tags, and javascript
test for i.e. less than v5.5
HELP!! Browser Detection with JScript
Window.Opener.Document.getElementById("name").innerHTML - update problems
Inserting Multiple Records into MSaccess Database
How to find local user settings with Javascript
validate a textbox

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics