Solved

Trouble submitting with onunload

Posted on 2004-09-29
7
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 52

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
Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

 

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

739 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