Contributions

Features (Category Index)
Search: 

Enforce Attribute Select

Enforces the user to select one of the options in the drop-down options menu, besides the default option. If the user does not select an option, a pop-up menu appears. With this contrib the user cannot add the product to the shopping until one of the options is select.

Expand All / Collapse All

Alternative 0.1 23 Sep 2009

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.

Alternative 4 Sep 2006
Enforce Attribute Select 28 Dec 2005

Note: Contributions are used at own risk.