paraiko / molgenis_apps-legacy

MOLGENIS Advanced Application and Computation Framework for the Life Sciences
www.molgenis.org
0 stars 1 forks source link

Bind enter key to text/inputbox edited instead of to form submits #16

Closed paraiko closed 5 years ago

paraiko commented 11 years ago

Bind enter key to text/inputbox edited instead of to form submit Example: When a user enters a filter and presses the enter button the page is reloaded instead and not the filter applied.

paraiko commented 11 years ago

see #45

When enter is pressed on a page it defaults to the main submit button of the form, which is not always the intended action (for instance changing the paging size in matrix, with enter results in hitting the reload instead of the apply butttion

this is an annoyance of several users!

possible solutions:

$("#id_of_textbox").keyup(function(event){ if(event.keyCode == 13){ $("#id_of_button").click(); } });

see http://stackoverflow.com/questions/155188/trigger-a-button-click-with-javascript-on-the-enter-key-in-a-text-box