473,683 Members | 2,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

submitting a form through another frame

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.f ormname.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?

Jul 23 '05 #1
14 6891
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.f ormname.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
Jul 23 '05 #2
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.f ormname.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?

It sounds like you want to use the standard body unload event instead of
trying to create a "tab-click" event.

On the form page: <body onunload="docum ent.forms[0].submit()">

Is that what you're asking?
Jul 23 '05 #3
Thanks for replies. I've tried the <body> onunload and onbeforeunload
events but both have flaws as far as this specification is concerned.
onunload destroys the form BEFORE I have a chance to submit.
onbeforeunload has the same sporadic behavior as accessing the submit()
event from another frame not to mention the fact that it's only
supported in IE...
Any other ideas perhaps?

**gotta love those frames!!!!!**

Jul 23 '05 #4
threeflush wrote:
Thanks for replies. I've tried the <body> onunload and onbeforeunload
events but both have flaws as far as this specification is concerned.
onunload destroys the form BEFORE I have a chance to submit.
onbeforeunload has the same sporadic behavior as accessing the submit()
event from another frame not to mention the fact that it's only
supported in IE...
Any other ideas perhaps?

**gotta love those frames!!!!!**

I can't reproduce this at all. Have you tried validating your HTML? Any
chance you could post a (short) misbehaving version of your pages?
Jul 23 '05 #5
What do you mean by "validating "? I'll post an abridged version
shortly... Thanks.

Jul 23 '05 #6
Sounds like you need to fire functions in a careful order. First no
matter what tab you click the current 'page content' should be
"submitted" so when you create the tabs the first thing to do is to do
this submit --in other words they all do the same thing. Then you can
do the "tab" function to change the "page content" page. You will then
have to update the state of the "tab" frame. A very tricky bit of code
for sure.

Jul 23 '05 #7
threeflush wrote:
What do you mean by "validating "? I'll post an abridged version
shortly... Thanks.

Using software to confirm that your HTML follows the rules. It's amazing
how a couple of misplaced HTML tags can wreck some perfectly good
JavaScript.

Try http://validator.w3.org/
Jul 23 '05 #8
Thanks, the validator found sound minor errors so I will correct those
and give it another go. I've found that posting an abridged version of
the code is too difficult as it's very complex (not my design, I might
add!).

Jul 23 '05 #9
So I've found that calling the bottom form's submit() using this
javascript:

parent.frames[4].document.info. submit();

works ONLY if I also include a javascript alert immediately after this
line, like such:

parent.frames[4].document.info. submit();
alert('whatever ');

This got me thinking about implementing some sort of delay or sleep
function.

Does anyone have any idea why it would always work if I "pause" with a
javascript alert?

Thanks.

Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2316
by: Mats | last post by:
Hi Maybee a little bit of topic, but is it possible to stay on the submitting page once you've clicked submit. This is to get processing done on page B when you submit on page A, and the page should not change. Normally I use a response.redirect to the submitting page, but that can't be done in one case. Mats PS I've found that one solution is to send Response.Status = "204 No Response" but according to some information that won't work...
4
9253
by: Kathryn | last post by:
I hope you can help as this is driving me crazy! I have an asp which has 3 frames on it as follows: <FRAMESET rows="50%,*,10%"> <FRAME src="rundetailstop.asp" name="rundetailstop" scrolling="no"> <FRAME src="rundetails.asp" name="rundetails" scrolling="auto"> <FRAME src="rundetailsbottom.asp" name="rundetailsbottom" scrolling="no"> </FRAMESET>
4
2730
by: Kai Grossjohann | last post by:
I have two frames. Frame "search" contains a search form specifying an onsubmit action like so: <form ... onsubmit="foo();"> ... </form> The other frame contains a <img ... onclick="perform_search();"> where the perform_search function is defined as follows:
1
1167
by: Aaron Ward | last post by:
Does anyone know how to submit values from a page without frames to a certain frame in another framed page? Any help would be greatly appreciated, Aaron Ward Digipen Institute of Technology
5
1904
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
2
2176
by: bsmith | last post by:
Having a little problem with a project my boss gave me. We have a web based hosting site that we have multiple databases that the users can connect to. Right now we have it set up that they can choose the database they want to login to but he wants it to login to the only database the user is allowed to see. I have a login script that I am using on another project that works great by using redirect. The problem I have with the doing the same...
2
3628
by: Abneo | last post by:
Hi all, I am very new to Javascript and I am in some need of some help. I am creating a site that has a madlib. I got the madlib code but now I want the results of the madlib to display in another frame. The user input will be in one from and the output should be in seperate frame. I have written the code for the madlib but when I hit the submit button it does not do anything. Here are my codes for the pages. The frameset code is ...
6
4974
by: phpnewbie26 | last post by:
This has been confusing me for a while. I don't understand why it isn't working. In my original coding, I have an action called submitted.php and this is what is looks like: <?php $data=fopen("/home/vchan/ts2/writing.txt","r+"); while(!feof($data)){ $data2=fgets($data); $tmp=explode(",",$data2); $project=$tmp; $code=$tmp;
0
8504
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9042
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8922
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8751
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6429
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2934
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2195
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.