JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 12th, 2001, 04:36 AM
Kev77 Kev77 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 44 Kev77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Javascript Key Locking

Is it possible to lock the return key on a form, so it cant be pressed, and the form submitted.

Reply With Quote
  #2  
Old July 12th, 2001, 08:54 AM
Jay Edgar Jay Edgar is offline
The one who gets it done
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Madison, WI
Posts: 395 Jay Edgar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 32 m 22 sec
Reputation Power: 12
Send a message via Yahoo to Jay Edgar
Sure. disable it. Something like: document.FORMNAME.BUTTONNAME.disabled=true;

Idea 2: Change the button so that instead of being type=submit, onclick="submitFunction();", or some such. In that function use whatever testing to decide if it will submit the form: document.FORMNAME.submit();

Cheers,

J

Reply With Quote
  #3  
Old July 12th, 2001, 09:05 AM
admap admap is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 5 admap User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You should be able to.

I would think all you would need to do is trap all keyboard activity and allow any trapped key except return carry on as normal while sinking a return keypress to a false return.

I know this can be done on text fields and form elements I am not 100% sure about the forms themselves but dont see why not.


Even if you cant do it on the whole form itself you can do it on each form element. Just on each element have the onKeyPress() event handler invoke a function that checks the keycode generated and filter out return keys (I THINK the return key code is 13, but again not 100% sure)


I hope this gets you in the right direction if you need more I will gladly post more later when I have my resources in front of me.

**Ive tried the disabled thing, didnt seem to work all the time across platforms, let me know if you try it and it does for you I will go back and see what I snafu'd **

Last edited by admap : July 12th, 2001 at 09:45 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Javascript Key Locking

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap