Trigger submit button on enter key press from textbox

$(function(){
    $('#textbox').keypress(function (e) {
        var key = e.which;
        if (key == 13)  // the enter key code
        {

            $('#submit').click();
            return false;

        }
    });
});

Comments

Popular posts from this blog

SQL Interview Questions and Answers

Generic Interface and Factory Pattern in C#

How to get device info IMEI programmatically in xamarin android