Had a problem where the error would come up for product id #s that shared the options id numbers. So made this modification to ignore any id numbers that weren't hidden. (i.e. the product id )
Had problems when there were articles not having all enforced attributes assigned to them. So i changed the if to a switch statement. Now you are also able to have some text in the alert box.
function validate() {
var i = 0, s = '';
while (document.cart_quantity.elements[i]) {
if (document.cart_quantity.elements[i].type != 'hidden') {
switch (document.cart_quantity.elements[i].value) {
case "89" : s+="Bitte Kettenlänge wählen.n"; break;
case "80" : s+="Bitte Armbandlänge wählen.n"; break;
case "81" : s+="Bitte Damenringgröße wählen.n"; break;
case "82" : s+="Bitte Farbe wählen.n"; break;
case "83" : s+="Bitte Gravur wählen.n"; break;
case "84" : s+="Bitte Gravur Schriftart wählen.n"; break;
case "88" : s+="Bitte Herrenringgröße wählen.n"; break;
default: break;
}
}
i++;
}
if (s != '') {
alert(s);
return false;
}
}
no files to download just make updates here.
More...




LinkBack URL
About LinkBacks









Bookmarks