Jim Lane wrote:<form name="myForm"
action="http://www.berriesandmore.com/cgi-bin/checkout.pl" method="POST"
onLoad="return CheckForm(this);"
onSubmit="SetCookie ('NumberOrdered', 0, null, '/');document.location=('managecart.html')">
<SCRIPT>
CheckoutCart();
</SCRIPT>
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.
You will never know if that happens, because of a quirk in JavaScript that cancells the submition of a form if another command follows the submit command.
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
Randy