Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Auto form submit and redirect

843836Sep 9 2003 — edited Sep 9 2003
I have a jsp page with a form which posts to another jsp page which updates a database with the info that the user has put into the form. Is is automatically submitted using the javascript using onUnload so that the data is saved what ever happens to the page.
However I want the user to be able to click on a link in that page to go else where in the application and the auto submit to work. But what happens is the submit forces the 'action' page to be loaded.

Form page:
<script>
function save()
{
document.forms[0].submit()
}
</script>
<body onUnload="save()">
...
<form name=getName method=post action="updateName.jsp">
...blah form stuff..
</form>
...

So I need somehow to pass something to the updateName.jsp page so that it can then redirect itself to the users intended page.

Any Ideas??

Many Thanks, Ian
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 7 2003
Added on Sep 9 2003
2 comments
3,197 views