New Discussion

Notifications

You’re not receiving notifications from this thread.

Action listener for submit on return??

1
General

How would I make this code (that refers to a select box: https://developer.snapappointments.com/bootstrap-select/examples/) submit the selection by pressing the return key?

function sample_function() {
$('select_box').on('changed.bs.select', function (e, clickedIndex, isSelected, previousValue) {

});
}

You can listen on keydown event and detect when return is pressed and call the function. More on keydown event here https://developer.mozilla.org/en-US/docs/Web/API/Document/keydown_event

Join the discussion
Create an account Log in

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.