You are here: Re: Submit Form « PHP Programming Language « IT news, forums, messages
Re: Submit Form

Posted by Malcolm Dew-Jones on 10/01/29 11:23

=?ISO-8859-1?Q?Nisse_Engstr=F6m?= (PvovotkNOSPAM@tele2.se) wrote:
: On 5 Aug 2005 15:10:01 -0700,
: bryanhales<bryanhales@gmail.com> wrote:
: > bettina@coaster.ch wrote:
: > > I want to submit a form but without a submit button. That's to say, I
: > > want that by giving a definite code in a field and then press <ENTER>
: > > the form will be submitted.
: > > For Example
: > > <form name="search_form" method="post" action="search.php">
: > > ....
: > > ...
: > > Code: <input type="text" name="code" onKeyPress="if (event.keyCode ==
: > > 13) {document.search_form.submit()};">
: > >

: Strange. A simple

: <input type="text" name="code">

: tends to work for me. Even in IE.

It doesn't work in all browsers. In some browsers you have to have a
submit button.

: > > How can I do it without a submit button?

: Beware, there is no shortage of pages with broken Javascripts
: where forms cannot be submitted *at all*. Not having a submit
: button is *extremely* rude in those cases.

I agree, a form should always have a submit button if you intend it to be
submitted. A plain submit button (i.e. no javascript) will work in 100%
of browsers, and makes it plain to every user how to submit. Having a
submit button does not prevent the user from simply pressing the Enter key
to submit the form in those browsers that do that, so nothing is lost by
having a button.


--

This space not for rent.

 

Navigation:

[Reply to this 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

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