I am trying to get my HTML form (a login page) to submit when pressing enter in the last field, but I don't know how to do it. The submit button works fine, but I want to be able to submit by pressing enter too.
Here's my code:
I've done some googleing but most people seem to be asking how to disable the function rather than enable it. If it makes a difference, I'm running the latest version of Firefox. Any help is appreciated.
Here's my code:
Code:
<html>
<! This page is the main index page and serves as the login page for all users>
<! This page is referenced by all pages as the default redirect>
<! This page references /verify.php through /verify.js>
<head>
<meta http-equiv="refresh" content="120" >
<script src="verify.js"></script>
<title>CASA Login</title>
<link rel="stylesheet" type="text/css" href="/ref/main.css" />
<link rel="stylesheet" type="text/css" href="/ref/maincolor.css" />
</head>
<body>
<div id="logo"><img src="/ref/Logo.gif" alt="" /></div>
<table width="500px" id="text">
<tbody>
<tr>
<td><label for="name">User Name</label></td>
<td><label for="pass">Password</label></td>
</tr>
<tr>
<td><input type="text" size="12" name="name" id="name" maxlength="8"/></td>
<td><input type="password" size="12" name="pass" id="pass" maxlength="8"/></td>
</tr>
</tbody>
</table>
<div id="submit"><input type="button" value="Login" onclick="verify()" /></div>
<div id="message"></div>
</body>
</html>
I've done some googleing but most people seem to be asking how to disable the function rather than enable it. If it makes a difference, I'm running the latest version of Firefox. Any help is appreciated.