There are a number of questions on SO asking how to set the value of a selected dropdown, such as How to Display Selected Item in Bootstrap Button Dropdown Title. This works great, until you add a 2nd (or 3rd...) dropdown to the page. What then happens is that selecting a value on dropdown A will set that value on dropdown B and C as well...
Here's my fiddle
$(".dropdown-menu li a").click(function () {
var item = $(this).text();
$(".btn:first-child").text(item);
$(".btn:first-child").val(item);
});
The current selector is selecting all dropdowns.. wheras what's needed is to select the button within the selected dropdowns button group, or traversing via parents, both of which I've failed to work out.
Any help appreciated.