brotherton-erpnext/erpnext/templates/includes/product_search_box.html
2014-04-21 13:43:35 +05:30

29 lines
904 B
HTML

<div style="margin-bottom: 20px;">
<form class="form-inline form-search row">
<div class="input-group col-md-4 col-md-offset-8">
<input class="form-control" type="text" id="product-search" placeholder="Product Search...">
<span class="input-group-btn">
<button class="btn btn-default" type="button" id="btn-product-search">
<i class="icon-search"></i></button>
</span>
</div>
</form>
<script>
// redirect to product search page
frappe.ready(function() {
$('.dropdown-toggle').dropdown();
$("#btn-product-search").click(function() {
var txt = $("#product-search").val();
if(txt) {
window.location.href="product_search?q=" + txt;
}
return false;
});
$("#product-search").keypress(function(e) {
if(e.which==13) $("#btn-product-search").click();
});
$(".form-search").on("submit", function() { return false; });
});
</script>
</div>