views:

441

answers:

2

I need to prompt an alert message when a user selects a particular option in a select menu. Is there a way to do this using jQuery?

A: 

I recently bumped into the jQuery Confirm Plugin. It may or may be what you are looking for.

ayaz
+2  A: 

assuming your select has an ID of myselect, and the value you want to check is "myval"

$("#myselect").change(function() {
   if($(this).val() == "myval")
    {
       alert('message');
    }
});

I havent tested this but the concept should be sound

Neil Aitken