Drop-down menu verification

Hi all,

I’ve got a couple drop-down menus that I’m trying to get a JavaScript verification to work with. I got it to work with one drop-down menu, but when I tried to get it to work with two… I got stuck…
Basically, the drop-down’s are “size” and “colour” the default is “choose a size” followed by “XL”, “L”, “M” and “S” , so I have it checking to see if the value is not xl or l or m or s then alert! Pretty straight forward…

Here is the script that worked with one drop-down menu:


[LEFT]var value = product_option_value("men_size");
if (value !== 'XL' && value !== 'L' && value !== 'M' && value !== 'S') {
alert("Please select a size");
return false;
}[/LEFT]

Here is what I tried for **two **drop-down menus (does not work):


[LEFT]var value = product_option_value("men_size");
if (value !== 'XL' && value !== 'L' && value !== 'M' && value !== 'S') {
alert("Please select a size");
}
var value2 = product_option_value("colour_001");
if (value !== 'black' && value !== 'off-white') {
alert("Please select a colour");
return false;
}[/LEFT]

I’d like to avoid it opening two alerts one after another, So I was thinking It would be great if I could get a script to do three scenerios.
If A and B then alert 1
If A then alert 2
If B then alert 3