inputTags-jQuery-plugin icon indicating copy to clipboard operation
inputTags-jQuery-plugin copied to clipboard

keypress enter submit form

Open xavierbruno opened this issue 1 year ago • 0 comments

//code solves form submit problem

$(function(){
    var keyStop = {
    8: ":not(input:text, textarea, input:file, input:password)", // stop backspace = back
    13: "input:text, input:password", // stop enter = submit 

    end: null
    };
    $(document).bind("keydown", function(event){
    var selector = keyStop[event.which];

    if(selector !== undefined && $(event.target).is(selector)) {
        event.preventDefault(); //stop event
    }
    return true;
    });
});

xavierbruno avatar Mar 22 '24 17:03 xavierbruno