You could modify your call on your web page to call AddToCart() with the values you wish to add instead of the 'This.Form'
-or-
you could change my code to work like the old by changing the top to grab the values from the form as follows:
- Code: Select all
function AddToCart(thisForm) {
if ( thisForm.ID_NUM == null )
itemNumber = "";
else
itemNumber = thisForm.ID_NUM.value;
if ( thisForm.QUANTITY == null )
itemQty = "1";
else
itemQty = thisForm.QUANTITY.value;
if ( thisForm.PRICE == null )
itemPrice = "0.00";
else
itemPrice = thisForm.PRICE.value;
if ( thisForm.NAME == null )
itemName = "";
else
itemName = thisForm.NAME.value;
(keep the rest of the function the same)
One other change:
RemoveFromCart --- I added a new parameter 'DoRefresh' since I didn't always want to have the page reload when an item is removed. You'll need to remove that parameter, and the corresponding 'if' statement.
Good luck!
