In MSIE
If there is no 
<pre>
<INPUT TYPE=SUBMIT>  
</pre>
then it IE wont automatically process the Enter Key as a submit

here is a script I found in the archive

<pre>

<SCRIPT LANGUAGE="JavaScript">
<!--
//script by Dave Shelley
NS4 = (document.layers) ? true : false;

function checkEnter(event) 
{
var code = 0;
if (NS4) 
 {
 code = event.which;
 } 
else 
 {
 // alert(event.keyCode);
 code = window.event.keyCode;
 };
if (code==13)
 {
  if (reCheckForm()) 
   {
     document.form1.submit();
   }; 
  };
};

function watchKeyPress() 
{
if (NS4) 
{
  document.captureEvents(Event.KEYUP);
};
if (document.all) 
{
 // document.onkeyup = checkEnter(event);
 } 
  else 
 if (NS4 || document.getElementById) 
 {
 document.onkeyup = checkEnter;
 };
};
// -->
</SCRIPT>

<BODY BGCOLOR="#EEEEEE" LEFTMARGIN="0" TOPMARGIN="0" RIGHTMARGIN="0"
BOTTOMMARGIN="0" ONLOAD="watchKeyPress();"
ONKEYUP="checkEnter(window.event)">

</pre>

Take care,

Ben Johansen - http://www.pcforge.com
Authorized Witango Reseller http://www.pcforge.com/WitangoGoodies.htm 
Latest downloads & List Archives @ http://www.witango.ws


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Campbell, Steve V.
Sent: Wednesday, October 09, 2002 2:48 PM
To: Multiple recipients of list witango-talk
Subject: Witango-Talk: RE: Re: [OT] ASP page return key function

Hello

This is off topic but I have looked in my JavaScript book but can't
remember this for the life of me. I have coded a simple form page as an
.ASP.

I have a submit button for users to hit when the form is filled out but
I have had a request for them to be able to hit the return key if they
choose not to hit the submit button. 

I thought his was possible to have it work either way.  If not, then
please just overlook this mail. Any help would be appreciated.

Thanks

Steve Campbell


________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to