473,770 Members | 7,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Don't submit form on Enter button

Who knows how to prevent submitting a form on the press Enter button before
all fields on the form are filled up.
People just enter the first field hit Enter and it submits the form and
doing validation,
of course flushing with the bunch of messages because rest of the fields are
empty.
I remember I had some pages where wrote the code to go on the next field
when pressed the Enter button (Tab like), because it didn't go anywhere at
all.
Tested it on a few machines, same result.

Thanks,
Michael

Jul 10 '07
24 8444
Anthony Jones wrote on 12 jul 2007 in
microsoft.publi c.inetserver.as p.general:
>Feeling stupid has nothing to do wich whose fault it is, but is a
mighty strong incentive for a steep learning curve.

What does that mean??
Seems I cann't help you there.
>Perhaps the word "stupid" should only appear after the third <enter>?

If the OP follows my suggestion on the code tweaks nothing happens
when enter is hit.

If he also takes the time to explain respectfully how and why the new
interface is different no one ever needs to be called stupid,
especially not by a mere computer.
>My way they would not see those two alerts any more in an hour,
and also target the ones that are on holyday, congress, ill, sick,
buzy elsewhere or just too sleepy during your "conference room with a
projector" happening to notice.

However, in a setting where money is no object, and absolute
politeness is, your idea might eventually work.

Since I have actually managed people and have had to do things similar
to that in the past I can tell you it isn't expensive or pointless and
it does work. People should treat people with respect, computers
should treat people like gods.
Wow, then we should not take the most used OS as an example.

I suppose you also tried to do it the way I suggested,
or else you wouldn't know from experience.

btw, do you expect everyone to be serious? ;-)
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 12 '07 #11

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:uZ******** ******@TK2MSFTN GP03.phx.gbl...
Anthony Jones wrote:
"MichaelK" <Ka*******@west .zomax.comwrote in message
news:uL******** ********@TK2MSF TNGP06.phx.gbl. ..
Thanks guys for responds.
I already figured it out.
Just had to change the type from "submit" to "button". Had this
problem long long time ago, just forgot how I solved it that time.
Seems it's what Anthony was metioned.

About standard Tab - I know that, just the forms were written for
our internal data entry people,
and it's a pretty difficult task to make them to don't press Enter
every time and use Tab instead.
So it was easier to capture Enter key and send them to the next
entry field.
Makes you wonder what they were using before that taught them to use
the enter button.

?
Most Windows apps: Excel, Access, etc., use the Enter key for field/cell
navigation. Even Word: you press Enter to get to a new line, not Tab.
None of the above are good analogies of standard computer form based system.

In Word the tab key follows the same function that it does on a typewriter.
It moves to the next tab stop.
Pressing enter or return starts a new line similar to what happens in on a
typewriter. There is no concept here of the next field or control to move
to.

In Excel the tab key always moves to the next cell to the right. Again with
its origins on the typewriter this is natural. If you do that a few times
and hit enter see what happens, it goes to the cell under the cell which you
were in when you first started your series of tabs. It is true that enter
can move to the next cell on the right if the that seems to be what you want
currently. But it can also will move you to the row. It just makes enter
key behaviour quirky and less predictable.

However open any dialog on these apps and hit enter what happens? Compare
that with hitting Tab in those dialogs? (In fact you can click in one of
the tool bar embedded controls and try the same tests). The truth is nearly
every windows app that displays an actionable set of controls uses enter to
submit (if it has a default button) and tab to move between controls.
:-) It sounds like you turned on your first computer to a browser and ran
nothing except that for your entire computing life ... ;-)
Actually my first experience of this pre-dates windows. Big-iron IBM
systems for Bill of Materials and stock control. The old 3270 terminals
would again use tab to move between the fields and enter to submit the page.
It is this standard that Windows adopted and MS published in design
guidelines. It has become the industry accepted standard.

I know I am _that_ old. ;)
--
Anthony Jones - MVP ASP/ASP.NET
Jul 12 '07 #12
"Evertjan." <ex************ **@interxnl.net wrote in message
news:Xn******** ************@19 4.109.133.242.. .
Anthony Jones wrote on 12 jul 2007 in
microsoft.publi c.inetserver.as p.general:
Feeling stupid has nothing to do wich whose fault it is, but is a
mighty strong incentive for a steep learning curve.
What does that mean??

Seems I cann't help you there.
Perhaps the word "stupid" should only appear after the third <enter>?
If the OP follows my suggestion on the code tweaks nothing happens
when enter is hit.

If he also takes the time to explain respectfully how and why the new
interface is different no one ever needs to be called stupid,
especially not by a mere computer.
My way they would not see those two alerts any more in an hour,
and also target the ones that are on holyday, congress, ill, sick,
buzy elsewhere or just too sleepy during your "conference room with a
projector" happening to notice.

However, in a setting where money is no object, and absolute
politeness is, your idea might eventually work.
Since I have actually managed people and have had to do things similar
to that in the past I can tell you it isn't expensive or pointless and
it does work. People should treat people with respect, computers
should treat people like gods.

Wow, then we should not take the most used OS as an example.
I suppose you also tried to do it the way I suggested,
or else you wouldn't know from experience.

btw, do you expect everyone to be serious? ;-)
I can't tell when you're being serious or not. Partly because the text
medium removes much from communication and partly because I do tend to be a
literal thinker.

--
Anthony Jones - MVP ASP/ASP.NET
Jul 12 '07 #13
Anthony Jones wrote:
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:uZ******** ******@TK2MSFTN GP03.phx.gbl...
>Anthony Jones wrote:
>>"MichaelK" <Ka*******@west .zomax.comwrote in message
news:uL****** **********@TK2M SFTNGP06.phx.gb l...
Thanks guys for responds.
I already figured it out.
Just had to change the type from "submit" to "button". Had this
problem long long time ago, just forgot how I solved it that time.
Seems it's what Anthony was metioned.

About standard Tab - I know that, just the forms were written for
our internal data entry people,
and it's a pretty difficult task to make them to don't press Enter
every time and use Tab instead.
So it was easier to capture Enter key and send them to the next
entry field.

Makes you wonder what they were using before that taught them to use
the enter button.

?
Most Windows apps: Excel, Access, etc., use the Enter key for
field/cell navigation. Even Word: you press Enter to get to a new
line, not Tab.

None of the above are good analogies of standard computer form based
system.

In Word the tab key follows the same function that it does on a
typewriter. It moves to the next tab stop.
Pressing enter or return starts a new line similar to what happens in
on a typewriter. There is no concept here of the next field or
control to move to.

In Excel the tab key always moves to the next cell to the right.
So does Enter, which is a boon for people entering a lot of numeric
data.

Open Calculater and perform this calculation without using the mouse:
4+5*9=
What key did you press instead of clicking the "=" button? I doubt it
was tab ;-)

Think of an accountant entering a list of numbers from a printout or a
bunch of receipts or invoices: she will use her left hand to keep track
of where she is, and her right hand to enter the values using the number
pad. Think of the loss of productivity if she had to use the Tab key
instead of the Enter key on the number pad.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 12 '07 #14
Anthony Jones wrote:
...Apologise prefusely to them for having them use an
application in the past that did not conform to this
standard and could they please use the tab button from
now on.
Yeah - just because their telnet/3270 applications were designed and written
before the web browser even existed, those old programs should have gotten
with the eventually-to-become-standard program.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Jul 12 '07 #15


--
Anthony Jones - MVP ASP/ASP.NET
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:OH******** ******@TK2MSFTN GP02.phx.gbl...
Anthony Jones wrote:
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:uZ******** ******@TK2MSFTN GP03.phx.gbl...
Anthony Jones wrote:
"MichaelK" <Ka*******@west .zomax.comwrote in message
news:uL******* *********@TK2MS FTNGP06.phx.gbl ...
Thanks guys for responds.
I already figured it out.
Just had to change the type from "submit" to "button". Had this
problem long long time ago, just forgot how I solved it that time.
Seems it's what Anthony was metioned.

About standard Tab - I know that, just the forms were written for
our internal data entry people,
and it's a pretty difficult task to make them to don't press Enter
every time and use Tab instead.
So it was easier to capture Enter key and send them to the next
entry field.

Makes you wonder what they were using before that taught them to use
the enter button.

?
Most Windows apps: Excel, Access, etc., use the Enter key for
field/cell navigation. Even Word: you press Enter to get to a new
line, not Tab.
None of the above are good analogies of standard computer form based
system.

In Word the tab key follows the same function that it does on a
typewriter. It moves to the next tab stop.
Pressing enter or return starts a new line similar to what happens in
on a typewriter. There is no concept here of the next field or
control to move to.

In Excel the tab key always moves to the next cell to the right.

So does Enter, which is a boon for people entering a lot of numeric
data.
Like I said what the Enter key does varies depending on what Excel
intelligently interprets what you want it to do.
>
Open Calculater and perform this calculation without using the mouse:
4+5*9=
What key did you press instead of clicking the "=" button? I doubt it
was tab ;-)
No, why would I press the tab, there are no other fields to navigate to :P
Think of an accountant entering a list of numbers from a printout or a
bunch of receipts or invoices: she will use her left hand to keep track
of where she is, and her right hand to enter the values using the number
pad. Think of the loss of productivity if she had to use the Tab key
instead of the Enter key on the number pad.
Again the cacluator is not representive of the species. It doesn't even
give the one input control it has the focus.

Enter does what you would expect it to in a standard UI, completes the
operation, (even though the calc doesn't really conform otherwise) it isn't
being used for field navigation.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jul 13 '07 #16
Anthony Jones wrote:
>>In Excel the tab key always moves to the next cell to the right.

So does Enter, which is a boon for people entering a lot of numeric
data.

Like I said what the Enter key does varies depending on what Excel
intelligently interprets what you want it to do.
So? How does that invalidate my assertion? The fact remains that I can
perform cell navigation in Excel using the Enter key.
>Open Calculater and perform this calculation without using the mouse:
4+5*9=
What key did you press instead of clicking the "=" button? I doubt it
was tab ;-)

No, why would I press the tab, there are no other fields to navigate
to :P
No, but most business application users are used to this model: type in the
data and press Enter to signal that the current piece of data is finished
and move to the next field. In fact, they are so used to this that they take
it on faith that this will happen, continuing to type in data without even
looking at the screen to confirm that the expected navigation has taken
place.
>
>Think of an accountant entering a list of numbers from a printout or
a bunch of receipts or invoices: she will use her left hand to keep
track of where she is, and her right hand to enter the values using
the number pad. Think of the loss of productivity if she had to use
the Tab key instead of the Enter key on the number pad.

Again the cacluator is not representive of the species. It doesn't
even give the one input control it has the focus.
And I seem to have failed to clarify my shift from the Calculater example
back to an application UI presenting a series of fields or cells in which
data is to be entered, such as Excel.
Enter does what you would expect it to in a standard UI, completes the
operation, (even though the calc doesn't really conform otherwise) it
isn't being used for field navigation.
Again, in Excel, Enter can, and is, used for cell navigation (I really do
not understand your denial of this fact.). And again, most users of business
applications that I have encountered balk at losing the ability to perform
single-handed data entry using the Enter key to navigate from
field-to-field. They are not interested in conforming to design
"standards" ', they are interested in performing their job in the most
efficient manner possible, and refuse to use applications that slow them
down.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 13 '07 #17


"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Anthony Jones wrote:
>In Excel the tab key always moves to the next cell to the right.

So does Enter, which is a boon for people entering a lot of numeric
data.
Like I said what the Enter key does varies depending on what Excel
intelligently interprets what you want it to do.

So? How does that invalidate my assertion? The fact remains that I can
perform cell navigation in Excel using the Enter key.
It doesn't
>
Open Calculater and perform this calculation without using the mouse:
4+5*9=
What key did you press instead of clicking the "=" button? I doubt it
was tab ;-)
No, why would I press the tab, there are no other fields to navigate
to :P

No, but most business application users are used to this model: type in
the
data and press Enter to signal that the current piece of data is finished
and move to the next field. In fact, they are so used to this that they
take
it on faith that this will happen, continuing to type in data without even
looking at the screen to confirm that the expected navigation has taken
place.
I'm sorry but my exprience is different.
>
Think of an accountant entering a list of numbers from a printout or
a bunch of receipts or invoices: she will use her left hand to keep
track of where she is, and her right hand to enter the values using
the number pad. Think of the loss of productivity if she had to use
the Tab key instead of the Enter key on the number pad.
Again the cacluator is not representive of the species. It doesn't
even give the one input control it has the focus.
And I seem to have failed to clarify my shift from the Calculater example
back to an application UI presenting a series of fields or cells in which
data is to be entered, such as Excel.
Hold on you equate cells with fields. I don't accept that you can equate
the contigeous set of cells in a spreadsheet with a set of data entry fields
in a form.
>
Enter does what you would expect it to in a standard UI, completes the
operation, (even though the calc doesn't really conform otherwise) it
isn't being used for field navigation.
Again, in Excel, Enter can, and is, used for cell navigation (I really do
not understand your denial of this fact.).
I didn't, in fact I've given you quite an explicit description of how the
enter key does actually work in Excel.
And again, most users of business
applications that I have encountered balk at losing the ability to perform
single-handed data entry using the Enter key to navigate from
field-to-field.
Ok I accept where single handed data entry is required (we're talking pure
numerical info here) then the abiility to use the numeric pads enter key to
move to the next field is sensible. Is that a general or a specific case?
They are not interested in conforming to design
"standards" ', they are interested in performing their job in the most
efficient manner possible, and refuse to use applications that slow them
down.
I completely agree that we should give the users whatever is the most
sensible and natural UI we can.

--
Anthony Jones - MVP ASP/ASP.NET
Jul 13 '07 #18
Anthony Jones wrote:
>
Hold on you equate cells with fields. I don't accept that you can
equate the contigeous set of cells in a spreadsheet with a set of
data entry fields in a form.
From a computer science pov, you are certainly correct. Users will usually
fail to appreciate the distinction. I made a brief attempt several years ago
but had to admit defeat.
>And again, most users of business
applications that I have encountered balk at losing the ability to
perform single-handed data entry using the Enter key to navigate from
field-to-field.

Ok I accept where single handed data entry is required (we're talking
pure numerical info here) then the abiility to use the numeric pads
enter key to move to the next field is sensible. Is that a general
or a specific case?
In my experience, it's been the general case. Most of my applications
involve numeric entry and, if I forget to capture and redefine the Enter
keystroke, I hear about it. Of course, I don't forget anymore, because I've
got a js library file that I include in every form I create.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 13 '07 #19

"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcomwrote in message
news:ey******** ******@TK2MSFTN GP06.phx.gbl...
Anthony Jones wrote:

Ok I accept where single handed data entry is required (we're talking
pure numerical info here) then the abiility to use the numeric pads
enter key to move to the next field is sensible. Is that a general
or a specific case?

In my experience, it's been the general case. Most of my applications
involve numeric entry and, if I forget to capture and redefine the Enter
keystroke, I hear about it. Of course, I don't forget anymore, because
I've
got a js library file that I include in every form I create.

Interesting. OTH I have had users go on at me because I failed to supply a
default action which is initiated by the enter button and that's not just in
Web apps. I guess it just goes to show that even with a long career you
can't generalise on your own experience. I'll try to remember that in
future.
--
Anthony Jones - MVP ASP/ASP.NET
Jul 13 '07 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6048
by: Mark Michel | last post by:
Hi. I have made an html form which I would like to send by e-mail. When the recipient receives the e-mail form, I would like them to be able to fill it out and click the Submit button which will submit to an ASP page. This ASP page contains the code to submit the form data to a database. The page works fine when viewed through a browser, but the form will not submit in Outlook 2002 (I haven't tried other mail programs). Any...
7
20931
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open the asp page. When I use _blank target there is no problem, either I use GET or POST method. But when I use _search target, only GET method works.
2
1866
by: Matt | last post by:
The problem is I have 3 buttons that need to submit the form to different URL. My approach is to declare <input type="submit"> rather than <input type="button">. And put the following in the JavaScript: InputForm.action="URL LOCATION" InputForm.method="POST"; I think we don't need InputForm.submit(); because <input type="submit">.
2
73382
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example, I have a simple form such as the following: <form method="POST" action="submit.php" name="AForm"> Name: <input type="text" name="Name" length="20"><br> Age: 15 <a href="age.php">change age</a><br> <input type="submit" name="submit"...
19
2169
by: Bruce Duncan | last post by:
I know this isn't a php group but I was wondering if my problem is with my javascript in my php code. I'm debugging someone else's code and I can't figure out why this form won't submit. This code doesn't do anything: <?PHP $var1 = "http://localhost/php/index.php"; $varx = "bruce"; echo "<form name='formx3' method='post'><input type='text'><input type=button value=go onclick=document.formx3.action='".$var1."';
1
2799
by: Matt | last post by:
The problem is I have 3 buttons that need to submit the form to different URL. My approach is to declare <input type="submit"> rather than <input type="button">. And put the following in the JavaScript: InputForm.action="URL LOCATION" InputForm.method="POST"; I think we don't need InputForm.submit(); because <input type="submit">.
6
1922
by: nikou_70 | last post by:
I have a page with image, image has some image map, I want to submit form when user mouseover that image map, my code is like this: <img src="Images/floor4.jpg"usemap="#planetmap" id="IMG1"> <map id="planetmap" name="planetmap"> <area id=f4 shape="circle" coords="65, 93, 11" alt="CF4588" onmouseover=overf4()>
1
2104
by: tuckertickler | last post by:
I am brand new to this and trying to get a "submit form" to enter it's information into a database I have with www.servage.com. They have MySQL and I have created a database with their system. I just don't know the principal or procedure to gather information from a submit form (ie customer information) and transfer that to my database, or else also how to show or track customer balances and transaction histories. Is there any packaged system...
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10230
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.