Current location: Hot Scripts Forums » General Web Coding » JavaScript » how to disable "Enter" key in post forms


how to disable "Enter" key in post forms

Reply
  #1 (permalink)  
Old 11-05-03, 07:17 PM
magda magda is offline
New Member
 
Join Date: Nov 2003
Location: Toronto
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
how to disable "Enter" key in post forms

I have a very simple form to collect data that is then emailed to an address. You can see it here:
http://torontoprincipalscentre.com/membership.shtml

Is there a way to limit the post action to the "Submit" button?

Some users hit "Enter" and submit incomplete forms by accident, then have to go back and fill out the whole form again, etc.

I don't want the "mandatory" fields to actually BE mandatory in the code.

Here's the beginning and end of the form:

<form method="post" action="http://www.rna.ca/cgi-bin/formmail.pl">
... etc ...
<input type="submit" value="Submit Application" name="butSubmit">

Any help would be much appreciated.
Reply With Quote
  #2 (permalink)  
Old 11-06-03, 11:55 AM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
This is javascript, I havent tried it but it may be what you want...

http://www.dynamicdrive.com/dynamici...sableenter.htm
Reply With Quote
  #3 (permalink)  
Old 11-08-03, 12:07 AM
magda magda is offline
New Member
 
Join Date: Nov 2003
Location: Toronto
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Works great. Thanks!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 11:16 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.