How does one stop the enter-key from working?

  • Thread starter =?iso-8859-1?B?TXIuRyAgKEC/QCk=?=
  • Start date
?

=?iso-8859-1?B?TXIuRyAgKEC/QCk=?=

Hi and thanks in advance. I have a form and if the enter-key is
pressed the from terminates and they never get to finish it. Is there
a way to turn off the enter key? thanks.
 
L

Leif K-Brooks

Mr.G (@¿@) said:
Hi and thanks in advance. I have a form and if the enter-key is
pressed the from terminates and they never get to finish it. Is there
a way to turn off the enter key?

That's standard, expected functionality. When an even slightly clueful
user presses the enter key in a form, they want to submit it. Don't make
that more difficult.

If people submitting the form prematurely is an issue, add a validator
which redisplays the form with an error message, pre-filled with
whatever data the user has entered already, when the submission is
incomplete.
 
S

scripts.contact

Hi and thanks in advance. I have a form and if the enter-key is
pressed the from terminates and they never get to finish it. Is there
a way to turn off the enter key? thanks.

you need some js:

function check(ev,form){
ev=window.event||ev;
var e=ev.target||ev.srcElement
if(ev.keyCode==13){
if(/submit|reset/i.test(e.type)||
e.tagName.toLowerCase()=="button")return
for(var i=0,es=form.elements;es!=e&&i<es.length;i++){}
es[i+1].focus()
return false
}
}

In html:

<form ... onkeypress="return check(event,this)">
....
</form>


Test(ie users, stay away):
http://tinyurl.com/27r76r
 
T

Travis Newbury

That's standard, expected functionality. When an even slightly clueful
user presses the enter key in a form, they want to submit it. Don't make
that more difficult.

I HATE that functionality! I want to click a button to submit the
form, if I press the enter key, I want it to do a carriage return or
nothing.
If people submitting the form prematurely is an issue, add a validator
which redisplays the form with an error message, pre-filled with
whatever data the user has entered already, when the submission is
incomplete.

This sucks even more than the enter key.NOTHING worse then repeated
being told the form is not complete because it mistakenly tries to
submit it when I pressed the enter key.

YMMV
 
L

Leif K-Brooks

Travis said:
I HATE that functionality! I want to click a button to submit the
form, if I press the enter key, I want it to do a carriage return or
nothing.

So don't press the enter key, or -- if you have epilepsy or something --
reconfigure your browser so the enter key won't do that. Don't force
your preferences on everyone else.
 
J

Jukka K. Korpela

Scripsit Travis Newbury:
I HATE that functionality! I want to click a button to submit the
form, if I press the enter key, I want it to do a carriage return or
nothing.

So whenever you use Google, you want type in the search string, then look
for the mouse and try to click on the submit button, instead of pressing the
enter key (with no need for a mouse for this simple operation)?

What does a carriage return do in a single-line input field?

I have sympathy for your sentiments as regards to large forms, especially
forms with handlers that aren't prepared to handling incomplete submissions.
But the feature itself is very useful and natural and it was even described
as suggested behavior in early HTML specifications - for a form with a
single input field (optionally with checkboxes and radio buttons, but no
other fields for text input). Some browsers then implemented it for _all_
forms, and here we are.

It might be a good idea to disable the enter key in large forms, to the
extent possible, but it is important to realize that it cannot be completely
disabled and users _will_ submit data that is not all they meant to send, so
they should be given a chance to complete the form when the handler detects
the situation.
 
T

Travis Newbury

I have sympathy for your sentiments as regards to large forms, especially
forms with handlers that aren't prepared to handling incomplete submissions.

I was speaking about larger forms and not a google search or something
similar.
 
T

Travis Newbury

So don't press the enter key, or -- if you have epilepsy or something --
reconfigure your browser so the enter key won't do that. Don't force
your preferences on everyone else.

So you can force YOUR preference on me, but I can not force mine on
you?
 
J

Jonathan N. Little

Travis said:
I was speaking about larger forms and not a google search or something
similar.
Back in the day, old Netscape communicator would only submit on enter
key if and only if the form had 1 text field. Guess that default
behavior has been lost. But since a form should have some sort of
validation, incomplete data should be trapped. If JavaScript is
available prechecking with JavaScript can save a submit cycle. So with
proper form handling this should be a non-issue.
 
N

Neredbojias

Hi and thanks in advance. I have a form and if the enter-key is
pressed the from terminates and they never get to finish it. Is there
a way to turn off the enter key? thanks.

I used to have trouble with the "Window" key (or whatever it is) so what I
did is pry it off with a screwdriver. Worked like a champ!
 
B

Blinky the Shark

Neredbojias said:
I used to have trouble with the "Window" key (or whatever it is) so
what I did is pry it off with a screwdriver. Worked like a champ!

The block of keys above the inverted-tee arrow keys varies from keyboard
to keyboard. Sometimes the block

Insert Home PageUp

Delete End PageDn

forms the top two rows of a 3x3 key matrix there, and sometimes it forms
the bottom two rows of such a matrix.

I don't need the other three keys that appear in such a grid, and always
remove them so I don't hit them when I mean to use the vertically
adjacent keys of the above six-key set. :)

(I replace keyboards every several months, preferring not to bother
cleaning them when new ones are less than 10$US apiece.)
 
J

John Hosking

Blinky said:
I don't need the other three keys that appear in such a grid, and always
remove them so I don't hit them when I mean to use the vertically
adjacent keys of the above six-key set. :)

What, afraid that if you hit Pause/Break the PC'll stop working?
(I replace keyboards every several months, preferring not to bother
cleaning them when new ones are less than 10$US apiece.)

Typical attitude from someone who's got a couple fins to spare...

(Still not very environmentally conscionable. Bad Blinky.)
 
B

Blinky the Shark

John said:
What, afraid that if you hit Pause/Break the PC'll stop working?

Even if a misplaced keystroke doesn't do anything nasty, it's still a
wasted keystroke because it didn't accomplish what I wanted it to.
Typical attitude from someone who's got a couple fins to spare...

At ten or less clams, it doesn't take many fins. :)
(Still not very environmentally conscionable. Bad Blinky.)

I'm also a source of CO2.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed Blinky the Shark
The block of keys above the inverted-tee arrow keys varies from keyboard
to keyboard.

I hate that. For some reason only known to &Diety; I went through three
keyboards in six months, and they all seemed to be different in that area.

And... to make matters worse, the system I used at work did the same thing.

Then the Gods smiled on me and my friend gave me an older keyboard that
felt similar to the old IBM - ahhh, the old IBM keyboards, ahhh....
 
S

Sherm Pendley

Adrienne Boswell said:
Then the Gods smiled on me and my friend gave me an older keyboard that
felt similar to the old IBM - ahhh, the old IBM keyboards, ahhh....

Old IBM keyboards, or *OLD* IBM keyboards?

In other words - PC or 3270? :)

sherm--
 
E

Ed Mullen

Adrienne said:
Gazing into my crystal ball I observed Blinky the Shark


I hate that. For some reason only known to &Diety; I went through three
keyboards in six months, and they all seemed to be different in that area.

And... to make matters worse, the system I used at work did the same thing.

Then the Gods smiled on me and my friend gave me an older keyboard that
felt similar to the old IBM - ahhh, the old IBM keyboards, ahhh....

LOL. This is too funny. Long story, short version. We moved into this
house in 1998. Since then I have periodically asked my wife: "Are you
sure there isn't a keyboard in your office closet?" Substantive denials
followed for the ensuing years. I last asked about it in March of this
year.

Well. She just retired and started getting "the cleaning bug." So, she
emptied out the closet in her office (finally!). And I am now typing on
a lovely IBM PC keyboard. One of those metal-framed, heavy-duty brutes
that sounds like a machine gun when I get to touch-typing on it.

Part #: 1391401
Copyright: Lexmark 1984
Date: 8/30/1995

I KNEW that damned keyboard was in there somewhere!!! <G>
 
N

Neredbojias

The block of keys above the inverted-tee arrow keys varies from keyboard
to keyboard. Sometimes the block

Insert Home PageUp

Delete End PageDn

forms the top two rows of a 3x3 key matrix there, and sometimes it forms
the bottom two rows of such a matrix.

I don't need the other three keys that appear in such a grid, and always
remove them so I don't hit them when I mean to use the vertically
adjacent keys of the above six-key set. :)

(I replace keyboards every several months, preferring not to bother
cleaning them when new ones are less than 10$US apiece.)

Yep, just about the same here. ('Course I don't have the trouble with salt
water corrosion.) You'd think they'd standardize the damn things, though I
s'pose anyone and everyone has a "better" idea.
 
N

Neredbojias

I'm also a source of CO2.

Perhaps you could get a catayltic converter?

Incidentally, I've been told I'm a great source of CH4 and SO2 but it never
made me any money...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top