Page 1 of 1

Using Choice Validation with Quantity on Shopping Cart pages

Posted: Wed Jan 12, 2011 10:23 pm
by norman
To use Choice Validation on Quantity on Shopping Cart pages have to edit the layout you use for the add to cart button and add the following code to the cart button tag:

Code: Select all

onclick="return validateattributes(this.form,'<actinic:variable name="ValidateDateMessage" encoding="perl" selectable="false" />');"
E.g. your cart button code may look like:

Code: Select all

<input type="image" 
   src="<actinic:variable name="CartButtonImage" />"
   name="_<Actinic:Variable Name="ProductID"/>" 
   alt="Add to Cart"
   />
And change to:

Code: Select all

<input type="image" 
   src="<actinic:variable name="CartButtonImage" />"
   name="_<Actinic:Variable Name="ProductID"/>" 
   alt="Add to Cart"
   onclick="return validateattributes(this.form,'<actinic:variable name="ValidateDateMessage" encoding="perl" selectable="false" />');"
   />
Note that the Cary button layout may contain 2 ocurrences of the imput tag, so you may have to add the line twice.