When use tab to access data fields and press "Enter" on "Next" button to submit form and precess to the next form, it work fine in IE but not in Firefox.
Here are the HTML code for your test:
Page 1: test_server1.html
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>onKeyPress bug in Firefox</title>
</head>
<body><h2>Page 1</h2>
<form name="form1" method="post" onsubmit="return false">
<table width="100%" border="0" cellpadding="0" cellspacing="8">
<tr>
<td width="15%" nowrap>Version:</td>
<td width="85%"><input type="text" name="textfield" value="1.00" readonly/></td>
</tr>
<tr>
<td nowrap>Serial Number:</td>
<td><input type="text" name="textfield" value="SN123456" readonly/></td>
</tr>
<tr>
<td nowrap>Site Name:</td>
<td><input type="text" name="textfield" value=""/></td>
</tr>
<tr>
<td align="center" colspan="2">
<hr />
<input name="btnBack" id="btnBack" type="button" value="< Back" disabled />
<input name="btnNext" id="btnNext" type="submit" value="Next >" onClick='document.location.href="test_user1.html"' onKeyPress='document.location.href="test_user1.htm l"'/>
<input name="btnCancel" type="reset" id="btnCancel" value="Cancel" /> </td>
</tr>
</table>
</form>
</body>
</html>
[/HTML]
Page 2: test_user1.html
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>onKeyPress bug in Firefox</title>
</head>
<body><h2>Page 2</h2>
<form name="form1" method="post" action="" onsubmit="return false">
<table width="100%" border="0" cellpadding="0" cellspacing="8">
<tr>
<td width="15%">Username:</td>
<td width="85%"><input type="text" name="username" value="admin" readonly /></td>
</tr>
<tr>
<td nowrap>Email Address:</td>
<td><input type="text" name="textfield3" /></td>
</tr>
<tr>
<td align="center" colspan="2">
<hr />
<input name="btnBack" id="btnBack" type="button" value="< Back" onClick='document.location.href="test_server1.html "' onKeyPress='document.location.href="test_server1.h tml"' />
<input name="btnNext" id="btnNext" type="submit" value="Next >" onClick='document.location.href="test_dns1.html"' onkeyPress='document.location.href="test_dns1.html " ' />
<input name="btnCancel" type="reset" id="btnCancel" value="Cancel" />
</td>
</tr>
</table></form>
</body>
</html>
[/HTML]
Page 3: test_dns1.html
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>onKeyPress bug in Firefox</title>
</head>
<body><h2>Page 3</h2>
<form name="form1" method="post" action="" onsubmit="return false">
<table width="100%" border="0" cellpadding="0" cellspacing="8">
<tr>
<td width="15%" nowrap>Primary DNS:</td>
<td width="85%"><input type="text" name="textfield" value="" /></td>
</tr>
<tr>
<td nowrap>Secondary DNS:</td>
<td><input type="text" name="textfield" value="" /></td>
</tr>
<tr>
<td>Domain:</td>
<td><input type="text" name="textfield" value="" /></td>
</tr>
<tr>
<td align="center" colspan="2">
<hr />
<input name="btnBack" id="btnBack" type="button" value="< Back" onClick='document.location.href="test_user1.html"' onKeyPress='document.location.href="test_user1.htm l"'/>
<input name="btnNext" id="btnNext" type="submit" value="Next >" onClick='document.location.href="test_datastore1.h tml"' onKeyPress='checkEnter(e)'/>
<input name="btnCancel" type="reset" id="btnCancel" value="Cancel" /> </td>
</tr>
</table>
</form>
</body>
</html>
[/HTML]------------------------------------------------------------------------------------------------------------------
I tried to use javascript for onKeyPress but it does not work at all in Firefox:
- function EnterKey(e)
-
{
-
var key;
-
-
if(window.event)
-
key = window.event.keyCode; //IE
-
else
-
key = e.which; //firefox
-
-
if(key == 13)
-
return true;
-
else
-
return false;
-
}