How to send enter key for logIn
How to send Enter key for logIn in MVC, when I have the following <a id="loginLink" href="#">login开发者_JAVA百科</a>
I do recommend not to use a link in the place of a submit button! But if you insist, you can include this jquery that will handle the enter event for you
$('body').keyup(function(e) {
if (0 != $('#loginLink').length && e.which == 13) {
//document.getElementById('formId').submit()
}
});
精彩评论