473,320 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Submit button and click vs. enter

All articles and tutorials I've seen on subject of forms say that if
there's name and value for submit button(input tag with
type="submit"), they'll get submitted along with the rest of the
form...

but I've just noticed (after debugging my perl script for quite a
while :/ ) that it is true only when user clicks on submit, and if
form is submitted via hitting enter you don't get name=value for
submit buttton...

Is that supposed to be like that, or I'm doing something wrong?
thanx,
ivan
Jul 20 '05 #1
2 9562
iv********@yahoo.com (ivanhoe) wrote:
All articles and tutorials I've seen on subject of forms say that if
there's name and value for submit button(input tag with
type="submit"), they'll get submitted along with the rest of the
form...

but I've just noticed (after debugging my perl script for quite a
while :/ ) that it is true only when user clicks on submit, and if
form is submitted via hitting enter you don't get name=value for
submit buttton...

Is that supposed to be like that, or I'm doing something wrong?


Nope, that's the way it is.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #2
iv********@yahoo.com (ivanhoe) wrote:
All articles and tutorials I've seen on subject of forms say that if
there's name and value for submit button(input tag with
type="submit"), they'll get submitted along with the rest of the
form...
Indeed. But since there is so much bogus info in articles and tutorials
on HTML, this should be checked from the specification.
but I've just noticed (after debugging my perl script for quite a
while :/ ) that it is true only when user clicks on submit, and if
form is submitted via hitting enter you don't get name=value for
submit buttton...
By "hitting enter", you presumably mean pressing the enter (return) key
when focused on a text input field. It is possible to tab to a submit
button and then submit the form by hitting enter, but this is a different
case, and I don't know about similar problems with it (it's effectively
equivalent to clicking on the button, except perhaps for handling
event attributes).

The answer is: Maybe, maybe not. The specifications are vague in this
issue, and browser behavior is close to madness. See
http://ppewww.ph.gla.ac.uk/~flavell/...mquestion.html
Is that supposed to be like that, or I'm doing something wrong?


You should not rely on getting the name=value pair when the form is
submitted by hitting enter in a text input field. And you should not rely
on _not_ getting it. This makes multiple submit buttons a risky affair
(if the form contains text input fields, as it usually does). So it is
better to use a different approach, e.g. letting the user make a choice
by selecting among radio buttons (and using a single submit button)
instead of selecting between different submit buttons.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #3

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

Similar topics

15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
5
by: http://links.i6networks.com | last post by:
I want to force the users to click submit to submit the forms. How do I disable "Enter Key" which will submit the form automatically when they entered the data in text field then pressed "enter key"
11
by: Sandra Castellanos | last post by:
Hello, I want to know what I have to do to make the enter key to submit forms. I read in another newsgroup that inserting an html hidden text box made the trick, and it actually does, but in my...
5
by: Girish | last post by:
I have TWO submit buttons of type IMAGE on my asp form. This renders as <input type="image">. I need to be able to eble the ENTER button for both buttons. Yes, I know that for the input type...
3
by: Russell | last post by:
I have a web page that i am using an image button as my submit button. The code behind the button works, but when I click enter on the web page, nothing happens. Can anybody tell me how to get my...
2
by: 23s | last post by:
My site's login page has a form w/ 2 textboxes and a submit button. If I'm in either of those textboxes (i.e., either one of the textboxes has focus), in any given browser, hitting "enter" on my...
10
by: Perry van Kuppeveld | last post by:
Hi, I have a problem with formatting a table including text fields wich can contain up to 255 chars. I need a table with 3 columns: - First column 50 % over the with a rowspan of the total...
2
by: Gayathri | last post by:
Please find the pasted html, <html> <script language="JavaScript" src="cal.js"></script><!-- Date only with year scrolling --> </head> <BODY onLoad="showDetails()"> <script...
9
by: learning | last post by:
Hi! Here's my situation: I have one textfield with one 'submit' button in PAGE1.PHP. When I click on the 'submit' button I am sent to PAGE2.PHP where I have a "switch" routine that checks...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.