This code is scaled down from a script I found many moons ago to have the enter
key emulate the tab key. I have tested quickly and this disables the enter as
submit.
Hope it works for you!
ver = navigator.appVersion; len = ver.length;
for(iln = 0; iln < len; iln++) if (ver.charAt(iln) == "(") break;
netscape = (ver.charAt(iln+1).toUpperCase() != "C");
function keyDown(DnEvents) { // handles keypress
// determines whether Netscape or Internet Explorer
k = (netscape) ? DnEvents.which : window.event.keyCode;
if (k == 13) { // enter key pressed
return false;
}
}
document.onkeydown = keyDown; // work together to analyze keystrokes
if (netscape) document.captureEvents(Event.KEYDOWN|Event.KEYUP);
"Alford, Gary" wrote:
> When setting an <input type="Submit"... button in an HTML or CFM form, the
> "enter" key is automatically linked to that button (pressing enter provides
> the same results as clicking the Submit button).
>
> Does anyone know of a way to disassociate the "Enter" key from the "Submit"
> button?
>
> ============================================
> Gary L. Alford
> Supplier Product Assurance
> Bell Helicopter Textron
> Phone: (817) 280-6233
> Fax: (817) 278-6233
> mailto:[EMAIL PROTECTED]
> ============================================
>
> -------------------------------------------------------------------------
> This email server is running an evaluation copy of the MailShield anti-
> spam software. Please contact your email administrator if you have any
> questions about this message. MailShield product info: www.mailshield.com
>
> -----------------------------------------------
> To post, send email to [EMAIL PROTECTED]
> To subscribe / unsubscribe: http://www.dfwcfug.org
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org