Reply to Re: How to submit a form when user presses Enter key

Your name:

Reply:


Posted by Chuck Anderson on 10/18/47 12:00

Daniel Klein wrote:
> On Tue, 15 Jan 2008 19:30:40 +0000 (UTC), axlq@spamcop.net (axlq)
> wrote:
>
>
>> In article <ts0qo3p6i33dh14e9aoookeldba13g1g3h@4ax.com>,
>> Daniel Klein <danielk@featherbrain.net> wrote:
>>
>>> I'm pretty new at php and web stuff so please be gentle with me.
>>>
>>> I'm trying to get a form to submit when the user presses the Enter
>>> key.
>>>
>> A browser should do this automatically on any form that contains a
>> text input field <input type="text" ...>. If you press Enter after
>> typing something in the field, the form should submit. Nearly all
>> browsers I have used do this.
>>
>> I don't know why you'd want it on forms without a text input field,
>> even with Javascript. As a user, *I* certainly don't want to be
>> submitting a form if I happen to press the Enter key.
>>
>>
>>> Why is this such a secret in the open source world we live in?
>>>
>> It's no secret. It's built into the browser.
>>
>
> I agree, but the problem is a little deeper than that. What if there
> are 2 (or more) submit buttons. What html needs to be there to
> indicate the 'default' button?
>
> Daniel Klein
>

First off .... It's IE that does not submit with Enter. Firefox does.

As far as I know there is no way to "indicate" the default button. If
there are two submit buttons, the first is submitted (by Firefox).

In that case, if necessary, I use JavaScript on text fields to disable
Enter from submitting.

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация