javascript form submit with page redirect using link

B

BrooklynWeb

I have a form that is spread over multiple pages for data entry. At
the top of the form are links to each page. In order to ensure that
the data is saved when moving from page to page, I have the following
javascript on each page.

Please note that the same js may be called when the "save" submit
button is clicked on the page (some pages have other validation). THE
PAGE ALWAYS SUBMITS AND SAVES when the save button is clicked.
However, when src is passed in as "link", I know that it is coming from
the tabbed links at the top. In that case, I force a submit, after
which the page automatically continues to the href in the link.

Now here's the WIERD part - when I simply enter data and click using
links to next page, the data IS NOT saved. However, if I refresh my
page, THEN enter data, and then click to next page, the DATA IS saved.
What does this mean? What is affected by the refresh? The same url is
at the top of the page. Any advice is appreciated.

<SCRIPT LANGUAGE="javascript">

function validateform(src, order){

if (src == "link")
{
document.frmBuyers.submit();
//alert("after submit")
}
return true;
}
</SCRIPT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top