# Drop-down menu verification

**URL:** <https://forum.kirupa.com/t/drop-down-menu-verification/235130>\
**Category:** Uncategorized\
**Created:** [August 8, 2007, 5:42pm UTC](https://forum.kirupa.com/t/drop-down-menu-verification/235130 "2007-08-08T17:42:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hroth](https://avatars.discourse-cdn.com/v4/letter/h/8e8cbc/32.png) [@hroth](https://forum.kirupa.com/u/hroth)\
**Post date:** [August 8, 2007, 5:42pm UTC](https://forum.kirupa.com/t/drop-down-menu-verification/235130/1 "2007-08-08T17:42:14Z")

</div>

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:

```auto

[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):

```auto

[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
