Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multi-page HTML form that uses a cookie

Status
Not open for further replies.
Apr 9, 2002
3
CA
I am attempting to make a multi-page form that passes information from one form to the next by using a cookie. I would like to send the data from the first page of the form to the cookie and re-direct the browser to the next page of the form when the user presses on the submit button, but I am unable to get the form to submit the data to a cookie and change the page to the second form at the same time. It's always either one or the other that works, not both.... Please help!!

I have included 2 examples of the first and last lines of the form where the functions are called -- On example is of when the form is able to redirect to the next page and the second example is of when the form creates a cookie properly....

Example #1 -- Redirect works

<FORM name=&quot;cookieTest&quot; method=&quot;post&quot; action=&quot;distributorForm2.htm&quot;>

<INPUT type=&quot;submit&quot; value=&quot;Continue&quot; onsubmit=&quot;go(this.form)&quot;>

Example #2 -- The cookie works

<FORM name=&quot;cookieTest&quot; method=&quot;post&quot; action=&quot;distributorForm2.htm&quot;>

<INPUT type=&quot;submit&quot; value=&quot;Continue&quot; onclick=&quot;go(this.form)&quot;>


 
try removing the <input type=submit

instead use a button and have a function call on it that does all the cookies and then submits the form.

function doFormCheck()
{
// check the form
// set the cookies
document.cookieTest.submit()
}
<FORM name=cookieTest method=post action=distributorForm2.htm>

<input type=button onClick=&quot;doFormCheck()&quot;> Gary Haran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top