You could simply attach an onKeypress event to the textboxes...

<input type="text"
onKeyPress="if(window.event.keyCode==13){this.form.submit();}">

This will ignore anything other than Enter (13).  I'm actually not sure
about that this.form part, off the top of my head that might be wrong... I
remember there being a way to get a reference to the form an <input>
belongs to, but that might not be it (parentform or just parent maybe?) 
The point though is that you are submitting the form, regardless of what
the correct reference is.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Wed, March 30, 2005 12:18 pm, Wendy Smoak said:
> From: "Abdullah Jibaly" <[EMAIL PROTECTED]>
>
>> I have a form with an <html:cancel /> followed by an <html:submit />.
>> How can I get the submit to be activated when enter is pressed inside a
> text box on that form?
>> It is activating cancel right now.
>
> What I do is put an invisible button at the top of my form.  (A button
> with
> an image that matches the background of the page.  It's there, but you
> can't
> see it in most browsers.)  Then you can do whatever you want with the rest
> of the form, hitting enter is like 'clicking' that button.  (Technically,
> I
> think this behavior is undefined-- an HTML form is really only supposed to
> have one submit button.)
>
> --
> Wendy Smoak
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to