Link to home
Start Free TrialLog in
Avatar of Robert Treadwell
Robert TreadwellFlag for United States of America

asked on

Jquery check value change across multiple Dropdownlist

I wanting to know is it possible to check the change of like Dropdownlist in one jquery function.
Currently I can check the change of one or another control, ie.   $('#<%= Allergies1DDL.ClientID %>').change(function () {... and then do the same for    $('#<%= Allergies2DDL.ClientID %>').change(function () {...  

But I would like to combine the change event to listen for change using an OR operator like,
 $('#<%= Allergies1DDL.ClientID %>' || '#<%= Allergies2DDL.ClientID %>').change(function () {...

Is this possible?  When I run the program the first item is only works.



//This section checks DropdownList on change if 'Other' has been selected if it has then Open Jquery UI and allow user to add item.
    $(document).ready(function () {
        $('#<%= Allergies1DDL.ClientID %>').change(function () {
            var aDDL = $(this).val();
            if (aDDL == "-1") {
                //Open Jquery Dialog             
                addDDLOpenDialog(-1, "Allergies");
            }
        });
    });

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of jagssidurala
jagssidurala
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial