List Manager Forum

Search Module trigger search on "enter"

User moon_682 2013-12-24 19:02:05

Is it possible to set the Search Module to trigger the search on "enter" after typing the search term?

It seems now that that the user must press the "search" button.

Moonsoft support 2013-12-26 11:13:35

Hello,

You should add some code at JOOMLA/modules/mod_listmanagersearch/assets/js/listmanagersearch.js. Add this:

$('.lms_search_input').keydown(function(event){
var code = event.which;
if(code==13){
$('.lms_search').click();
}
});

after:

$('.lms_search').click(function(){
var val=$(this).parent().find('.lms_search_input').val();
if (typeof observable !='undefined')
observable.publish('search',val);
});

Hope this helps. Regards,

User moon_682 2013-12-27 02:45:07

Brilliant! works fine. Many thanks!

...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!
...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!