473,396 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Form doesn't submit onUnload in Netscape

Dear Netscape/Javascript/Java gurus,

I am trying to submit a form onUnLoad when the user accidentally
closes the browser before clicking on a link to complete the
transaction.

On IE, this works fine.
But on Netscape or Mozzilla browsers, the form would simply not submit
when
the browser is closed.

here is the code.
<script language="JavaScript">
function CheckWindowClosed() {
document.MyForm.submit();
}
</script>

<body onLoad="FunctionHandler();" onUnload="CheckWindowClosed();">

Kindly let me know if there is any workaround or fix where I can get
this working on Netscape.

Thanks and Regards,
Yash
Jul 23 '05 #1
4 3286
On 3 May 2004 10:02:31 -0700, Yashwant wrote:

comp.lang.java.programmer,
comp.lang.javascript,
netscape.public.mozilla.general,
netscape.public.general

Please do not cross-post so widely in future
<http://www.physci.org/codes/javafaq.jsp#xpost>
Dear Netscape/Javascript/Java gurus, ..... <script language="JavaScript">


You have the wrong group.
<http://www.physci.org/codes/javafaq.jsp#js>

But then, I notice in your wild cross-posting
that one of the groups is actually the correct one.

Invalid group 'netscape.public.general'
dropped from cross-post.

F'Ups set to the correct group.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #2
Yashwant wrote:
Dear Netscape/Javascript/Java gurus,

I am trying to submit a form onUnLoad when the user accidentally
closes the browser before clicking on a link to complete the
transaction.

On IE, this works fine.
But on Netscape or Mozzilla browsers, the form would simply not submit
when
the browser is closed.

here is the code.
<script language="JavaScript">
function CheckWindowClosed() {
document.MyForm.submit();
}
</script>

<body onLoad="FunctionHandler();" onUnload="CheckWindowClosed();">

Kindly let me know if there is any workaround or fix where I can get
this working on Netscape.

Thanks and Regards,
Yash


This is not a good way of doing things. If the user clicks on a link,
do you want to also submit the form? Chances are that when your user
presses the submit button, this handler will also fire -- redundant.

Do you really want to submit data if the user closes the browers? This
goes against usability expectations. I expect that whenever I press the
X in the upper-right corner, that my browser will close, and I will not
send anything off.

Most likely (and I have not looked into it), Netscape is not sending it
on, because it is recognizing that the user wants to close the browser.
Why would it want to navigate to a new page, if the browser is being
closed? It is counter-intuitive.

Then again, you may have a perfectly good reason for doing this, that I
cannot think of. Explinations are welcomed.

Brian

Jul 23 '05 #3
ia*********@hotmail.com (Yashwant) wrote in message news:<8e**************************@posting.google. com>...
Dear Netscape/Javascript/Java gurus,

I am trying to submit a form onUnLoad when the user accidentally
closes the browser before clicking on a link to complete the
transaction.

On IE, this works fine.
But on Netscape or Mozzilla browsers, the form would simply not submit
when
the browser is closed.

here is the code.
<script language="JavaScript">
function CheckWindowClosed() {
document.MyForm.submit();
}
</script>

<body onLoad="FunctionHandler();" onUnload="CheckWindowClosed();">

Kindly let me know if there is any workaround or fix where I can get
this working on Netscape.

Thanks and Regards,
Yash


The comp.lang.java.programmer posting suggests that you believe that
javascript and java are somehow the same thing. Not true.

Your issue is with javascript.

Use a button and the 'onClick=CheckWindowClosed()' event handler.
Jul 23 '05 #4
On 3 May 2004 10:02:31 -0700, Yashwant <ia*********@hotmail.com> wrote:

[FUs set to clj]
I am trying to submit a form onUnLoad when the user accidentally
closes the browser before clicking on a link to complete the
transaction.
Then show a warning clearly on the page that closing the browser before
finishing the transaction will cause them to lose all their information.
On IE, this works fine.
But on Netscape or Mozzilla browsers, the form would simply not submit
when the browser is closed.
Why should it? The browser is closing. It doesn't make sense for an
application to do anything more than internal clean-up operations when the
user closes it. Initiating another round of HTTP requests should be out of
the question. Moreover, you do realise that browsers like Opera don't even
fire the unload event when they close.
here is the code.
<script language="JavaScript">


Though this is the least of your worries, that should read

<script type="text/javascript">

The type attribute is required, whereas the language attribute is
deprecated and should no long be used.

[snip]

Good luck,
Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #5

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

Similar topics

1
by: Display Name | last post by:
the customer I'm developing a site for uses a canned form-parsing page that allows her to have an email subscription opt-in page add emails to a list she can manage using a link that you point your...
6
by: kaeli | last post by:
Hey guys, This error occurs ONLY in Netscape 7.0. Not in 7.1. So, I think it's a bug. Buuuut... Has anyone had this problem or know of a fix? When attempting to have an onunload function...
7
by: AnnMarie | last post by:
My JavaScript Form Validation doesn't work at all in Netscape, but it works fine in IE. I made some of the suggested changes which enabled it to work in IE. I couldn't make all the changes...
14
by: Chris | last post by:
Heres my problem: <a href="javascript:void(document.buysell.submit())" target="_parent" onMouseOver="MM_swapImage('members','','images/membersf2.gif',1)" onMouseOut="MM_swapImgRestore()"><img...
12
by: DJ | last post by:
I have a .NET datagrid that has a column of dropdownlist controls. If the user changes the value in the dropdown in one or more rows I will set a flag. If the user subsequently attempts to (1)...
2
by: lmeng | last post by:
Hi, I am new to this Forum. Thanks in advance for any kind help. In the following HTML code, when I change the value of one text field then click "Modify" button, if the validation fails a...
7
by: Ant | last post by:
Hi, I'm, having some problems with this function. function displayElements() { for (i=0;i<document.forms.elements.length; ++i) { document.writeln(document.forms.elements.value); }
14
by: threeflush | last post by:
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...
5
by: jackchang1 | last post by:
I have an application that will submit the form when the page is closed (through onunload event), and it works fine in IE6. But it doesn't work in FireFox, and no data is sent. It seems to me that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.