Answers for "javascript submit form with tab key"

1

javascript submit form with tab key

jQuery.noConflict();
            (function ($) {
                $(document).ready(function(e) {
                    let baseForm = $("#FORM_ID"); //Enter Form's ID

                  //Enter Input's ID
                  baseForm.on("keydown", "#INPUT_ID", function(evt){
                    	let charCode = evt.keyCode || e.which;   

                        // If ENTER(13) or TAB(9) entered, submit form
                        if(charCode === 9 || charCode === 13){
                            evt.preventDefault();
                            baseForm.submit();  
                        }
                    });
                });
            })(jQuery);
Posted by: Guest on August-17-2020

Code answers related to "javascript submit form with tab key"

Code answers related to "Javascript"

Browse Popular Code Answers by Language