Solved

Trouble submitting with onunload

Posted on 2004-09-29
7
205 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
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 properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

760 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

19 Experts available now in Live!

Get 1:1 Help Now