Private: Home › Forums › HTML Templates › Mixed Modern and Professional HTML Template › Serach Box › Reply To: Serach Box
March 26, 2015 at 1:57 am
#2613
Participant
Hello,
Please wrap all the codes (HTML, CSS, jQuery, etc.) in code tag once you post them in the future.
As for the search problem, please open the js/include.js and find the following code:
// SEARCH ANIMATION
$('#header').on('click', '#search', function (e) {
e.preventDefault();
$(this).find('#m_search').fadeIn().focus();
});
Add the following code BELOW the found one:
$("#search").on( "keypress", function(e) {
if (e.which == 13) {
e.preventDefault();
$("#search form").submit();
}
});
So the code looks like:
// SEARCH ANIMATION
$('#header').on('click', '#search', function (e) {
e.preventDefault();
$(this).find('#m_search').fadeIn().focus();
});
$("#search").on( "keypress", function(e) {
if (e.which == 13) {
e.preventDefault();
$("#search form").submit();
}
});
Your form will now get submitted once you press the ENTER button.
Robert