disable enter and recommends from search

parent cfd87035
......@@ -228,7 +228,7 @@ $(document).ready(function () {
var pol_element = document.getElementById('polygon-list');
var typingTimer;
var typingInterval = 800; //milliseconds
var typingInterval = 300; //milliseconds
var productListGlobe = [];
var cartProductList = []; // this array represent DB where products will be stored
var productsToObtain = [];
......@@ -254,6 +254,15 @@ $(document).ready(function () {
}
});
// disable enter in search input
$('#ajax-input').on('keyup keypress', function(event) {
var keyCode = event.keyCode || event.which;
if (keyCode === 13) {
event.preventDefault();
return false;
}
});
// var PRODUCT_IN_LIST = false;
// function for making POST request to productList in view.py
......
......@@ -118,7 +118,7 @@
<!-- search form -->
<form role="form" action="#" method="get" class="sidebar-form">
<div class="input-group">
<input type="text" id="ajax-input" name="value" class="form-control" placeholder="Search region...">
<input type="text" id="ajax-input" name="value" autocomplete="off" class="form-control" placeholder="Search region...">
<span class="input-group-btn">
<button type="button" name="search" id="search-btn" class="btn btn-flat" onclick="erase_input()">
<i class="fa fa-eraser"></i>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment