threeflush wrote:
I'm supporting an ASP legacy application and need to implement
"autosave" functionality. I have two frames, one that holds tabs
displaying different pages a user can select, and the other that holds
the page content itself. If a user clicks on another tab without
clicking the Submit button, I want to submit the current form for them
and do some further processing.
The problem is that top.framename.formname.submit() only works
sporadically. Sometimes the document object of the page frame does not
exist. Is there any way to "guarantee" that the document object will
exist?
Has anyone ever encountered this problem or have any suggestions?
Hi,
Try FIRST to submit the form, then to replace the window with new content.
I guess your setup works sometimes because of raceconditions: Sometimes the
form is submitted before the whole page is replaced.
There are several ways to fix this.
The first thing I would try is to use the onUnload event in the page to do
the submitting, or at least give a warning.
I do not have a lot of experience with the onUnload handler. (It was
erractic when I first examined it, but that was Stoneage)
If that doesn't help, try to replace the hyperlinks in the frame that
replaces you formframe with javascript, so are are sure you first submit,
then replace.
This however can be a lot of work, depending on the number of hyperlinks.
By the way: Are that people that DON't submit the form, but demand that you
save it anyhow, perhaps, IT-managers?
('WORD does it, so why doesn't our app do it? Fix that bug please')
Dilbert?
Quite an unreasonable request IMHO....
Anyway, that doesn't help.
Good luck!
Regards,
Erwin Moller