Hi there,

I am using a very useful script from Dynamic Drive for preventing the 'Enter' key submit a form prematurely; instead it advances to the next field.

onKeyPress="return handleEnter(this, event)"

in the 'input' or 'select' statement calls the function below.

<script type="text/javascript">

* Disable "Enter" key in Form script- By Nurul Fadilah(nurul@REMOVETHISvolmedia.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code

function handleEnter (field, event) {
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
if (keyCode == 13) {
var i;
for (i = 0; i < field.form.elements.length; i++)
if (field == field.form.elements[i])
i = (i + 1) % field.form.elements.length;
return false;
return true;
Unfortunately, the form contains many entries- it is a score sheet for tennis matches.

It would be really good if I could define the field entry order so that each game could be entered rather than the field entry jumping about the form.

I was thinking of using an array to define the input id's - but don't know how to go about it....

Can anyone help?

thanks in anticipation,