<...">

Twitter boot triggers upload form (search)

<div class="btn-toolbar search-dropdown" style="float:left;margin-right:10px;"> <div class="btn-group"> <button class="btn btn-small">All Types</button> <button data-toggle="dropdown" class="btn btn-small dropdown-toggle"><span class="caret"></span> </button> <ul class="dropdown-menu" id="search-type"> <li> <label class="checkbox"> <input type="checkbox" name="tv" value="TV">TV</input></label> </li> <li> <label class="checkbox"> <input type="checkbox" name="movies" value="Movies">Movies</input></label> </li> </ul> </div> </div> 
+4
source share
4 answers

This is because <button> elements represent their own default form - they inherit the type="submit" attribute.

If you do not want them to do this, add the type="button" attribute so that it becomes a regular button.

+11
source

If you do not want to close the drop-down list when you click on this check box, you can do it like this:

 jQuery(document).ready(function($){ $('input[type="checkbox"]').on('click',function(event){ event.stopPropagation(); }); }); 
0
source

Use the <a> element, not the <button> , to switch the drop-down list. The only drawback is the potential rendering mismatches if you mix different types. If you are worried about this, also switch the submit button to <a> and use javascript to submit the onclick form.

0
source
 <div class="btn-toolbar search-dropdown" style="float:left;margin-right:10px;"> <div class="btn-group"> <button class="btn btn-small">All Types</button> <button data-toggle="dropdown" class="btn btn-small dropdown-toggle"><span class="caret"></span> </button> <ul class="dropdown-menu" id="search-type"> <li> <label class="checkbox"> <input type="checkbox" name="tv" value="TV" onclick="search()">TV</input></label> </li> <li> <label class="checkbox"> <input type="checkbox" name="movies" value="Movies" onclick="search()">Movies</input></label> </li> </ul> </div> 

0
source

All Articles