Cracked it!
OK - here's what you need to do - you need to add a hidden field right under the submit field with the same name as submit and a value of 1
For example, here's my earlier form:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form2" id="form2">
<input name="code" type="text" size="20">
<input type="submit" name="submit" onClick="return validate(form2)" value="Submit">
</form>
Now here's the new form:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="form2" id="form2">
<input name="code" type="text" size="20">
<input type="submit" name="submit" onClick="return validate(form2)" value="Submit">
<input type="hidden" name="submit" value="1">
</form>
Notice the hidden field at the bottom! Now you can fill out the form and just hit the enter key and it works. Still works if you hit the submit key itself and still works both ways in all other browsers.
RESULT! 😃
Thanks everyone for helping!
EDIT:
Ignore the onClick="return validate(form2)" . . . that's just used with a bit of javascript I use to check for a blank field!