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
Solved

Trouble submitting with onunload

Posted on 2004-09-29
7
208 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 50

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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Drawing a Polygon with Google Maps 3 389
Google forms auto fill based on text entered. 3 121
Intranet building Software 8 124
Problem to Popup 37 127
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…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
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 insert an Iframe into 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 : Open Page or Post…

808 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