Auto form submit and redirect
843836Sep 9 2003 — edited Sep 9 2003I 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