Latest news
Home » jQuery » jQuery Validation of login by pressing enter key

jQuery Validation of login by pressing enter key

Validate login by pressing enter key

$(“#username, #password”).keydown(function(event) {
// track enter key
var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode));
if  ( keycode  == 13) {   // key code for enter key
// force the keyboard  ‘Enter Key’ to implicitly click the Update button
validateLogin();
return false;
} else  {
return true;
}
}); // end of function

Leave a Reply

x

Check Also

How to Check Expired Sessions using jQuery Ajax and PHP

We can achieve using the php and ajax.The following ajax call execute in every 10 ...