RE: Suppressing carriage return in a form action??

by Klaas De Waele <klaas(at)gracegraphics.be>

 Date:  Thu, 5 Jul 2001 09:02:30 +0200
 To:  "'Jesse Houwing'" <j.houwing(at)student.utwente.nl>,
"'Berk/Devlin'" <armadill(at)earthlink.net>
 Cc:  "'hwg-techniques(at)mail.hwg.org'" <hwg-techniques(at)mail.hwg.org>
  todo: View Thread, Original
Of course, you could use the comon trick... a small checkbox/field that the
user should fill in.  You can check then through Javascript if the field is
completed or the checkbox is ticked.  You can then have an alert window
explaining required fields aren't completed, AND it could be because he hit
the return button.

- Kayjey -




-----Oorspronkelijk bericht-----
Van: owner-hwg-techniques(at)hwg.org
[mailto:owner-hwg-techniques(at)hwg.org]Namens Jesse Houwing
Verzonden: woensdag 4 juli 2001 16:20
Aan: Berk/Devlin
CC: hwg-techniques(at)mail.hwg.org
Onderwerp: Re: Suppressing carriage return in a form action??


Berk/Devlin wrote:

>On Wed, 13 Jun 2001 10:05:28 -0700, I asked:
>
>>I have a form (http://armadillosoft.com/epgy/join.php3) and my users are
accidentally submitting it prematurely by pressing <ENTER> to go to the next
field when they should be pressing tab.  
>>
>>Is there some way in HTML that I can convert the <ENTER> key to a tab or
at least suppress it unless the user is pointing to my SUBMIT button?
>>
>
>The helpful suggestions I received from hwg-techniques mostly involved
using JavaScript and I wanted the fix I implemented to work regardless of
whether JavaScript was turned on.  (And, also, I don't actually want to
validate every field, because they are free to not fill out every field.)  
>
There is a easy javascript solution that just disables the <eter> key 
for a form. It doesnt need to check all the fields or anything.

just include:
 onsubmit="return false;"

in the form tag

and:
    onclick="this.form.submit;"

in the <input type=submit> tag.

works like a charm

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.