I put a form inside a bootstrap dropdown, but when I click any of the fields in the form, the dropdown goes away. I have this piece of code but I don\'t know where to put it
You need to stop event from bubbling up the DOM tree:
$('.dropdown-menu').click(function(e) { e.stopPropagation(); });
event.stopPropagation prevents event from reaching the node where it's eventually handled by Bootstrap hiding menu.