roberto68 Posted March 23, 2015 Share Posted March 23, 2015 (edited) I've 4 dropdowns (multiple select) - when value of any changes = user selects -> append that option to <ul>, if deselect => remove that option from <ul> that dropdowns are in 1 form so right now I've smth like this - I know it is not all OK $(".submit").attr('disabled','disabled'); // $("#dropdowns").change(function() { if($(this).val()===""){ $(".submit").removeAttr('disabled'); } else { $(".submit").attr('disabled','disabled'); }for (i=1; i<4; i++) { $('#"dd"+i option').each(function() { //check if smth is selected in each dd if($(this).is(':selected') { var sel = $(this).(':selected').val(); if( $('ul').has("li").val() == sel){ // if there is an li with that value } else{ $('<li>').text(sel).prependTo('.categories'); // <ul> called categories } } }); } }); Edited March 23, 2015 by roberto68 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now