Solved

Trouble submitting with onunload

Posted on 2004-09-29
7
206 Views
Last Modified: 2010-04-07
I am trying to automatically submit a form when the "onunload" event fires.  The problem that I'm having is that the page doesn't seem to submit when I fire the onunload event.  Any ideas as to what may be happening?  A snippet of my code is attached below.  Thanks.

<body onunload="frmPhase.submit();">
  <form method="POST" name="frmPhase" action="TestPage.asp?Update=Y">
     <input type="test" name="DatatField">
  </form>
</body>
0
Comment
Question by:TheChos
  • 4
7 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 125 total points
ID: 12184883
The user has left; ended the session;  the page is dead.  The onunload event is for doing things like putting up a thank you for visiting message.  You cannot do forms processing off of it because there is no longer a place to send the response.  The user has left.

Cd&
0
 
LVL 49

Assisted Solution

by:Ryan Chong
Ryan Chong earned 125 total points
ID: 12186622
Generally what i will do to force what user entered is captured when they didn't click on the "submit" button and exit the page (including you close it by clicking cross (x) button at title bar) is to popup another page (as Cobol already mentioned, some sort of thank you page), so that we can save the info via that popup form.

Alternatively, you can close that popup form automatically for certain time interval if you want, so that user not getting irritated by the popup page.

regards
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12190492
And what about the growing number of users with popup blockers?  Even when you do get the popup fired transferring form data is unreliable; may trigger a security alert; and may be block with user settings because it is re-directed form data.

Cd&
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:TheChos
ID: 12338172
I was able to correct the problem using input from both responses.

Administator, please split the points.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12340291
TheChos,

You have the option to do the split.  Right after the last comment there is a link to split points.  Just click it that then you can assign points to multiple comments.

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12342131
TheChos,

Would you please explain the reason for the C.  As C is the lowest grade you can give it generally means that the experts were not very helpful, but your comments indicate that you solved your problem based on our comments.  

Cd&
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
easy wysiwyg web app db  for office football pool 9 59
how is Publish different from Save within WordPress? 5 51
USPS CityStateLookup question 3 74
I starting with php 12 114
Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now