Function Enterevent () {key = window.event.keycode; if (key == 0xD) {// Judgment Whether to press Enter to logon ();}}
Function logon () {if (Document.Forms [0] .loginid.value == "") {alert ("Please enter the login user name!"); Document.Forms [0] .loginid.focus (); Return False } If (Document.Forms [0] .password.value.length <4) {Alert ("For security reasons, the password must be greater than or equal to 4"); Document.Forms [0] .password.focus (); Return False;} Document.Forms [0] .doAction.value = 'access'; Document.Forms [0] .submit ();
Then define in TextField as follows: