Skip to content

Instantly share code, notes, and snippets.

@aboutjax

aboutjax/cart.js Secret

Created January 29, 2017 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aboutjax/6031e42738cee51ecd3361993be4dfb8 to your computer and use it in GitHub Desktop.
Save aboutjax/6031e42738cee51ecd3361993be4dfb8 to your computer and use it in GitHub Desktop.
function validateForm() {
if (deliveryMethod == "isDelivery") {
var date = document.forms["cart-form"]["attributes[Delivery Date]"].value;
if (date == "") {
$(".o-cart-form__delivery-method-content").addClass("has-error")
return false;
} else {
return true;
}
}
if (deliveryMethod == "isPickup") {
var date = document.forms["cart-form"]["attributes[Pickup Date]"].value;
if (date == "") {
$(".o-cart-form__delivery-method-content").addClass("has-error")
return false;
} else {
return true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment