NEED INPUT VALUES TO MATCH ARGS ARRAY OR THROW AN ALERT
This is what I have but I want the alert to refrence the var args= or throw the alert.
function qtymultiply(qty){
var fs=qty.parentNode.parentNode;
var subtotal=document.getElementById('subtotal');
var args=[1,2,4,6,8,10,20]; //array I need to match foreach element
var multiply=0.0;
var price=fs.cells[4].innerHTML;
var quantity=fs.cells[5].getElementsByTagName('input')[0].value;
var cost=fs.cells[6];
var rowsubtotal=fs.cells[7];
if(qty.value!=''||qty.value!=0){ //qty.value '0' not throwing alert? Need to match args elements
multiply+=price*quantity;
cost.innerHTML=parseFloat(multiply).toFixed(2);
sumsubtotal();
rowsubtotal.innerHTML=subtotal.innerHTML;
}
else {
alert('You only have these options: 1,2,4,6,8,10 or 20');
qty.focus;
}
}
Any help would be :cool: