• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] jQuery DropDown Menu Trigger Event

#1
[eluser]RaZoR LeGaCy[/eluser]
What I would like to do is lets say that we have 5 drop down menus right after the next. If the user selects option 2 from the first menu, I want all other menus to disappear/hide.

May be something simple but I am a total newbie in jQuery and Javascript. I know that I can simply add a css class that would inject into the menu divs and add class hideMenu but I am unsure how to write it.

Thank you.



Figured it out!!

Javascript
Code:
$(function() {

    $("#menuItem").change(function()
    {
        switch ($(this).val())
        {
            case '1':
        $("#disabledItem").attr("disabled","disabled");
            break;

            default:
        $("#disabledItem").removeAttr("disabled");
        }


    });
});

HTML
Code:
Menu Box in Html with id="menuItem"


Then textbox, checkbox etc with id's equal to disabledItem


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.