Enter to submit a form (or trigger a button)

If user press enter in a form which has  a button with type “submit”, the form will be submitted automatically.

Prevent submitting form by pressing enter:

<!-- Replace type value with "button" -->
<button id="bt_submit" class="btn btn-primary" type="button">Submit</button>
    $('#bt_submit').on('click', function(e){

Add keypress event listener

        $form.find('input[type="text"]').on('keypress', function(e){
            code = (e.keyCode ? e.keyCode : e.which);
            if(code == 13){