showing results for - "javascript submit form with tab key"
Luisa
20 Apr 2016
1            jQuery.noConflict();
2            (function ($) {
3                $(document).ready(function(e) {
4                    let baseForm = $("#FORM_ID"); //Enter Form's ID
5
6                  //Enter Input's ID
7                  baseForm.on("keydown", "#INPUT_ID", function(evt){
8                    	let charCode = evt.keyCode || e.which;   
9
10                        // If ENTER(13) or TAB(9) entered, submit form
11                        if(charCode === 9 || charCode === 13){
12                            evt.preventDefault();
13                            baseForm.submit();  
14                        }
15                    });
16                });
17            })(jQuery);