Jim Lane wrote:<form name="myForm"
onSubmit="SetCookie ('NumberOrdered', 0, null, '/');document.location=('managecart.html')">
This is what you are asking to be done:
onLoad CheckForm (this) calls the function to see if the customer has filled in all the required fields in the form...billing name, address etc.
Which of course he hasn't because the page just loaded, and had the alert box in his face before he could blink.
Then as soon as he presses the submit button the cart is emptied, and the form is not checked again...so the customer could checkout without filling in the required billing fields, and none the wiser...only to be thrown back to an empty managecart page.
I see by your form action, you are using checkout.pl.
Checkout.pl should send you and your customer email confirmation of the order, and may write to your order database csv file, and finally instruct the browser to load a thank-you page.
It is this thank-you page that has the onLoad=="SetCookie ('NumberOrdered', 0, null, '/')";
and a link to send them to your index.html page...now with an empty cart.
Hope that helps