Hi,
I have below code. I am using a button to sign in but now I want to perform the button click when the user submit the form by pressing enter on the txtLoginName or txtPassword.
How can I do this please?
- $('#btnSubmit').click(function ()
- {
- $("#wrapper").hide();
- $("#gradient").hide();
- $("#wait").show();
-
- $.ajax({
- type: 'POST',
- url: "login_user.php",
- data: $('#login-form').serialize(),
- success: function()
- {
- window.location.href = 'my.php';
- },
- error: function(jq,status,message)
- {
- alert('A jQuery error has occurred. Status: ' + status + ' - Message: ' + message);
- }
-
- });
- });