stefanocudini/bootstrap-list-filter

Disable form submission

finalwebsites opened this issue · 5 comments

Hi,

I like your plugin very much and I use it for several websites :)
Thanks for sharing!

I've noticed that some people always hit the enter button to execute a search, even if there is no button :)
Right now I'm using this code to disable the form submission:

$('.searchform').on('keyup keypress', function(e) { var keyCode = e.keyCode || e.which; if (keyCode === 13) { e.preventDefault(); return false; } });

Maybe it's something you like to add to your plugin?

ye sure... please fork the repo, test it and send me a pull request! ;-)

actually I use that code in my theme right now, didn't tried to add the code to your plugin :(

@finalwebsites can you paste here new code for this? I'll add it on main repository

@stefanocudini I use the code in my initial post on this issue (in a general JS file).

I didn't changed the plugin code.

ok tnk