View Full Version : help!!

11-21-2002, 04:14 AM
hi, i'm doing a login page for administrators. When the admin have entered the user name, password and have chosen the organisation which they are in, they would click the Log-In button to continue. Is there any way that when the admin have entered all the details and he/she just have to press Enter on the keyboard to continue instead of clicking the Log-In button?

here's my code, it's a jsp file:


<title>Administrator Login</title>

<script language="javascript">

function checking(name, password) {

if(name.length==0) {

window.alert("Please enter user name!");


} else if(password.length==0) {

window.alert("Please enter password!");


} else {






<body onLoad="document.login.user_name.focus()">

<h1><font color="blue">Administrator Login</font></h1>


<form name="login" action="admin_check.jsp" method="post">

<table align="center">

<td><b>User name :</b></td>
<td><input type="text" name="user_name" size="15"></td>

<td><b>Password :</b></td>
<td><input type="password" name="user_pass" size="15"></td>


<td><b>Organisation :</b></td>

<select name="org_options">

<td align="right"><input type="button" value="Log-in" onClick="checking(document.login.user_name.value, document.login.user_pass.value)"></td>





<center>Note: User ID and password is <b>NOT</b> case-sensitive.</center>



11-21-2002, 09:03 AM
changing this

input type="button"


input type="submit"

may do the trick

11-25-2002, 10:02 AM
afaik, the onclick event should be changed into an onsubmit event, if the user hits enter, there wont be an onclick event anymore

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum