MAC OS - in safari browser, key press event(13) leads to open next tab. how can i control it?

Asked By raja kumar on 05-Apr-13 01:44 AM
In safari browser, 5.1.7(7534.57.2), when i enter username and password and press key enter then it open the new tab, and the second press (again enter ) then it is login sucessfully.  remaining browsers working fine. please help me

name="userPwd" onkeypress="javascript:return checkTNNEWkey(event)"

function checkTNNEWkey(e) {
          try {
            var checkLoginFlag = false;
            if (!e) e = window.event;
            if (e.keyCode) checkLoginFlag = (e.keyCode == 13);
            else if (e.which) checkLoginFlag = (e.which == 13);
            if (e.target.id == "userPwd")
              isUserPwdEnter = true;
            if (checkLoginFlag) {
              CheckTNLogin();
              return false;
            }
            else
              return true;
          }
          catch (err) {
            alert('test');
          return false; }

        }