
// JavaScript Document
function validateMinQty(){
var min_qty = document.getElementById("min_qty");
var quantity = document.getElementById("Quantity1");
if(isNaN(quantity.value)) {
alert("You must enter a valid quantity.");
quantity.value=min_qty.value;
return false;
}
if(parseInt(min_qty.value)>parseInt(quantity.value)){
alert("You must order at least "+min_qty.value+" units.");
quantity.value=min_qty.value;
return false;
}
return true;
}
