Hi Stephen,
Include this function on the page
function disableEnterKey()
{
if (window.event.keyCode == 13) window.event.keyCode = 0;
}
Then any form you wish to disbale the enter key on, use the following:
<form name="form" method="post" action="" onKeyPress="disableEnterKey()">
This can also be achieved by submitting the form using the onClick event
handler instead of onSubmit event handler. It is necessary to return false
on event handler onSubmit to prevent submit on hitting ENTER key. Sample
code:
<form name="form1" onSubmit="return false">
<input type="text">
<input type="button" value="SubmitForm" onClick="document.form1.submit()">
<a href="#" onClick="document.form1.submit()"><img src="button.gif"></a>
</form>For a Javascript version, refer here
:
http://javascript.internet.com/forms/tab-key-emulation.htmlHope this
helps.Regards,Anushi