stefanocudini / bootstrap-list-filter

Search widget to filter Bootstrap lists
https://opengeo.tech/bootstrap-list-filter/
MIT License
99 stars 31 forks source link

Disable form submission #26

Closed finalwebsites closed 8 years ago

finalwebsites commented 8 years ago

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?

stefanocudini commented 8 years ago

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

finalwebsites commented 8 years ago

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

stefanocudini commented 8 years ago

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

finalwebsites commented 8 years ago

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

I didn't changed the plugin code.

stefanocudini commented 8 years ago

ok tnk