'Rails: Action listener submit on return

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) {
    
  });
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source