Welcome Guest, Not a member yet? Register   Sign In
Hide Dropdowns from each other with if statement???
#5

[eluser]Randy Casburn[/eluser]
disclaimer - I don't know jQuery all that well.
Code:
$('#todo_id, #project_id').click(function(){ // catch click event for the two dropdowns
   var clicked = $(this).attr('id').replace(/dropdown/,''); // get number of dropdown
   var notclicked = (clicked == 1)?'#project_id':'#todo_id'; //  <<<--- CHANGE
   $(notclicked).attr('disabled',TRUE); // disable not clicked dropdown
});

Try?

[edit] I change the dropdown DOM ids so they are correct now.


Messages In This Thread
Hide Dropdowns from each other with if statement??? - by El Forum - 08-24-2008, 06:26 AM
Hide Dropdowns from each other with if statement??? - by El Forum - 08-24-2008, 09:16 AM
Hide Dropdowns from each other with if statement??? - by El Forum - 09-04-2008, 01:18 PM
Hide Dropdowns from each other with if statement??? - by El Forum - 09-05-2008, 06:25 PM
Hide Dropdowns from each other with if statement??? - by El Forum - 09-05-2008, 07:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB