Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: auto form submit on ENTER key

  • Subject: Re: auto form submit on ENTER key
  • From: "Safalra" <usenet@safalra.com>
  • Date: 8 Aug 2005 04:30:31 -0700
  • Complaints-to: groups-abuse@google.com
  • In-reply-to: <dd3uso$2e5n$2@godfrey.mcc.ac.uk>
  • Injection-info: z14g2000cwz.googlegroups.com; posting-host=86.133.246.217; posting-account=3W0jiwwAAADMuxLVAgabFQ5x5h6JlUVk
  • Newsgroups: alt.html
  • Organization: http://groups.google.com
  • References: <km7Je.335$ZG2.336369@twister.nyc.rr.com> <dd3uso$2e5n$2@godfrey.mcc.ac.uk>
  • User-agent: G2/0.2
  • Xref: news.mcc.ac.uk alt.html:292909
Roy Schestowitz wrote:
> ppcguy wrote:
> > i've got a login page with name and password and
> > would like the form to be submitted with the
> > user presses on either of the two input fields.
> > it works if i do this
> > <INPUT TYPE="Submit" NAME="Submit" VALUE="Login">
> > but does not for this:
> > <INPUT TYPE="Button" NAME="Submit" VALUE="Login"
> > onclick="onSaveClicked(this)">
>
> Why would you ever want to use the latter if the former works? The simpler
> form gives you the correct behaviour by default...

I presume the the original poster wants to do something with Javascript
before submitting the form. If this is input validation (the most
common use of Javascript in forms), it's a really bad idea: never rely
on client-side validation - always perform it on the server side for
security.

--
Safalra (Stephen Morley)
http://www.safalra.com/programming/javascript/


[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index