473,791 Members | 2,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What happens if several text fields have the same name?

Like, I know if several checkboxes have the same name, I can get the
ones that were checked after submit with a request.form("n ame") and
maybe do a split(request.f orm("name"),"," ) to cycle through them.
I tried the same thing with textfields (input type=text), but doesn't
seem to work the same.
Do they behave differently?

Jul 24 '05
17 16187
On Wed, 25 May 2005, RobG wrote:
Alan J. Flavell wrote:
On Tue, 24 May 2005, Jim Moe wrote:
My experience is that you get the contents of the text box that is last
defined with a given name. None of the others show up.
Then you have an incomplete server-side implementation, but this is
off-topic for the HTML authoring group.


I disagree with that. If the OP is serving invalid HTML


I still see no evidence that the OP needs to serve "invalid" HTML to
achieve this.
text elements with duplicate names, browser behaviour is not defined
and you can't be certain of what will be returned to the server.


The behaviour is defined in
http://www.w3.org/TR/html4/interact/...#form-data-set

If two "successful controls" have the same name, then the "form data
set" submitted to the server will contain two name=value pairs with
the same name.

That is a specification of the form data set as submitted from the
browser/client to the server. It's not a specification of a software
interface between a server and a server-side process - you'd need to
look elsewhere for that, as I already said.
The HTML spec specifies the format of the submitted dataset (as
sent from the client to the server). That part is on-topic here.


And what the server sends to the client is irrelevant?


Congratulations , you're arguing against something that I never said.
At this point in the procedure the server neither knows nor cares
what kind of form control that was. They could easily be of
different kinds (e.g a pull-down list and a type-in text box of
the same name) if you wanted. Or not, as you choose.


If that was to occur in the same form, then that is invalid HTML


Where's your test document to demonstrate this claimed invalidity?
Jul 24 '05 #11
Gazing into my crystal ball I observed RobG <rg***@iinet.ne t.auau> writing
in news:%c******** *********@news. optus.net.au:
I disagree with that. If the OP is serving invalid HTML that has INPUT
text elements with duplicate names, browser behaviour is not defined
and you can't be certain of what will be returned to the server.

In that context, it is very much a HTML issue.


Here is an example of a form which uses the same name:
<http://www.intraproduc ts.com/beta/usenet/samecontrols.as p>

It is perfectly valid client side as well as server side.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 24 '05 #12
Alan J. Flavell wrote:
On Wed, 25 May 2005, RobG wrote:

Alan J. Flavell wrote: [...]
The HTML spec specifies the format of the submitted dataset (as
sent from the client to the server). That part is on-topic here.
And what the server sends to the client is irrelevant?

Congratulations , you're arguing against something that I never said.


You appeared to be dismissing the fact that what the server sends to
the client is also important.

The OP's view was that duplicate names on checkboxes or text inputs
should give similar results (name/value pairs with the same name).

Apparently that's not what occurred. Martin Honnen's reply is likely
sufficient explanation.
At this point in the procedure the server neither knows nor cares
what kind of form control that was. They could easily be of
different kinds (e.g a pull-down list and a type-in text box of
the same name) if you wanted. Or not, as you choose.


If that was to occur in the same form, then that is invalid HTML

Where's your test document to demonstrate this claimed invalidity?


The HTML 4 spec does not explicitly say you can't have form elements
with identical names. It does explicitly say how to deal with
checkboxes and radio buttons that share the same name, I understood
that to mean other form controls should not have identical names.

It appears that form elements with duplicate names validate quite
happily with the W3C validator. While that may not always be
sufficient proof of validity, I'm happy to accept it in this case when
there is no evidence to the contrary.

Score: me 0, AJF 1
--
Rob
Jul 24 '05 #13
On Thu, 26 May 2005, RobG wrote:
Alan J. Flavell wrote:
> The HTML spec specifies the format of the submitted dataset (as sent
> from the client to the server). That part is on-topic here.

And what the server sends to the client is irrelevant?


Congratulations , you're arguing against something that I never said.


You appeared to be dismissing the fact that what the server sends to
the client is also important.


Sure it's important, but it doesn't seem to be the problem here: what
the server is sending to the client is dependent on what the
server-side process has decoded from its interface to the server, and
that's evidently incomplete here. I'd still be recommending looking
at *that* part of the procedure (in its proper place,
comp.infosystem s.www.authoring.cgi if the interface in question is the
CGI). By the time the server-side process is composing HTML to send
to the client, it's too late.

cheers
Jul 24 '05 #14
RobG <rg***@iinet.ne t.auau> wrote:
It appears that form elements with duplicate names validate quite
happily with the W3C validator.
It's no surprise, given the fact that the 'name' attribute is declared
with CDATA content. We need not know more, as regards to validity.
While that may not always be
sufficient proof of validity,


You seem to be toying with some private definition for "validity";
maybe you meant "conformanc e to the HTML specification".

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

Jul 24 '05 #15
Jukka K. Korpela wrote:
[...]
While that may not always be
sufficient proof of validity,

You seem to be toying with some private definition for "validity";


Not at all.
maybe you meant "conformanc e to the HTML specification".


I don't understand your confusion, you seem to have understood the
meaning well enough - what other interpretation was inferred?

In this forum I would expect that the adjective "valid" and its
derivatives would be interpreted as conformance with the relevant W3C
HTML specification. I don't think that's a private notion.

The W3C 'validator' page proclaims:

"The W3C Markup Validation Service is a free service that checks Web
documents in formats like HTML and XHTML for conformance to W3C
Recommendations and other standards."

which I think tends to support that view - i.e. that 'valid' equates to
conformance to a specification.

The fact that a file is sent to the W3C markup validation service and a
response is returned that proclaims:

"This Page Is Valid HTML 4.01 Strict!"

does not, of itself, provide a 100% guarantee that it is, though I
would expect that in the vast majority of cases it does. Hence my
caution in declaring the response from the validator service as
absolute proof of validity - others are free to make up their own mind
on that point.

For me, when combined with advice from Alan Flavell and further reading
of the W3C HTML specification, it is quite sufficient and I said so.
--
Rob
Jul 24 '05 #16
On Tue, 31 May 2005, RobG wrote:
Jukka K. Korpela wrote:
[...]
While that may not always be
sufficient proof of validity,
You seem to be toying with some private definition for "validity";


Not at all.


"Valid" in an SGML or XML context is a technical term with a precise
meaning, as Jukka already knows very well, but you apparently do not.
maybe you meant "conformanc e to the HTML specification".


I don't understand your confusion,


(that's because you are confused... nothing to get excited about,
but not a good basis for an argument)
In this forum I would expect that the adjective "valid" and its
derivatives would be interpreted as conformance with the relevant
W3C HTML specification.
But that's not correct. Conformance with the text of the HTML
specification has quite a number of additional constraints which are
not part of being "valid" in the technical sense meant here.
Validity is determined by the applicable DTD, and only by the DTD,
nothing more.
The fact that a file is sent to the W3C markup validation service and a
response is returned that proclaims:

"This Page Is Valid HTML 4.01 Strict!"


Indeed, it says it's "valid" (and names the DTD which applied); it
doesn't say anything about whether it's conformant to additional
constraints in the text of the specification. For most everyday
purposes, it may be enough to know that it's valid; but if you're
going to set out to argue with specialists, then you need to know
exactly what it means to be "valid". And that's where you've caught
yourself out here, I'm afraid. Jukka can be a bit terse, but he's
correct on this point.

Jul 24 '05 #17
Alan J. Flavell wrote:
On Tue, 31 May 2005, RobG wrote:

Jukka K. Korpela wrote:
[...]
While that may not always be
sufficient proof of validity,

You seem to be toying with some private definition for "validity";
Not at all.

"Valid" in an SGML or XML context is a technical term with a precise
meaning, as Jukka already knows very well, but you apparently do not.

maybe you meant "conformanc e to the HTML specification".


I don't understand your confusion,

(that's because you are confused... nothing to get excited about,
but not a good basis for an argument)


No, I'm not confused. Wrong or misguided perhaps, but the fact that I
have a different understanding of something does not make me confused.

In this forum I would expect that the adjective "valid" and its
derivatives would be interpreted as conformance with the relevant
W3C HTML specification.

But that's not correct. Conformance with the text of the HTML
specification has quite a number of additional constraints which are
not part of being "valid" in the technical sense meant here.
Validity is determined by the applicable DTD, and only by the DTD,
nothing more.

[...]

Thank you for the explanation.

I had an inkling along those lines but clearly missed the subtlety of
Jukka's reference.

I now understand the difference, as understood here, between
conformance to the specification and "valid HTML". I think that
understanding is quite different to what may be assumed by a ordinary
person, but when in Rome...

Jukka could have explained his viewpoint in perhaps a few words, but
chose to be obscure. Perhaps that has resulted in a far better
explanation for all, so the general good has been served.
--
Rob
Jul 24 '05 #18

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

Similar topics

10
3728
by: ross | last post by:
I want to do some tricky text file manipulation on many files, but have only a little programming knowledge. What are the ideal languages for the following examples? 1. Starting from a certain folder, look in the subfolders for all filenames matching *FOOD*.txt Any files matching in each folder should be copied to a new subfolder within the current folder called EATING with a new name of *FOOD*COPY.txt
3
1550
by: P.Hill | last post by:
I have this simple bit of code that when you check a checkbox and it displays or hides two other fields (well actually two parts of the document with two different IDs. Pretty straight forward... I thought. The fields come and go, but something happens to the table formatting; on NS 7.1 and Firefox 1.0 it seems to miscount or hide the number of TD tags or something else confusing. Can anyone tell me what I'm doing wrong? -Paul
6
6187
by: Iver Erling Årva | last post by:
I am looking for a way to let the users copy e.g. a multi-line address from a textfile and paste it into a webpage where there is one input field for each address line in such a way that not only the first line is pasted, but instead the program automatically jumps to the next field and put line 2 in there and so on. Can this be done? I tried with onkeydown to check for event.keyCode == 13, but it doesn't seem to work with paste. Brgds
1
1763
by: Mad Scientist Jr | last post by:
I have a textbox control (for simplicity call it Text1) with autopostback turned on. It has a couple validators: RequiredFieldValidator_Text1 RegularExpressionValidator_Text1 The Text1 onchange (see code below) event does these things 1. fires the validators
3
1549
by: Terry Olsen | last post by:
I've got 2 different web pages, both updating the same SQL database. One is for the Technician and one is for the Manager. The technician's update page works fine but the Manager's update page doesn't. They are both the same..as far as I can tell... --------------------- This code works fine, updating the SQL database with the edited data. Code for Tech Page
8
2495
by: johnsonholding | last post by:
Here is the code for a pop-up window that works in Firefox and not in IE - I get a java error or something, Here is the code : </script> <SCRIPT language="JavaScript" type="text/javascript"> <!-- ; var newwindow = ''
5
5916
by: Rich | last post by:
Hello, I have a search application to search data in tables in a database (3 sql server tables). I populate 2 comboboxes with with data from each table. One combobox will contain unique CompanyID's. The second combobox will contain unique memberID's. Each of the tables that I have to search contain a CompanyID and a memberID field, and these fields are not unique in the respective tables. Like CompanyID, MemberID
4
1924
by: _Raven | last post by:
Okay, I am playing with submitting forms with Ajax. I am trying to adapt this script to my forms: http://www.captain.at/howto-ajax-form-post-get.php I have included my code at the bottom of this post. Basically, this will work correctly if I remove all non-form related tags from the form =eg span, div, but I want to format the form all pretty like so??? Right now, it only collects 2 parts of the form fields =sites &
1
1492
by: John Dalberg | last post by:
What causes a server event to fire when something happens on the client? Say a user changed the gridview's page index, the server side PageIndexChanged event is fires. What makes PageIndexChanged fires? Is it a field in the viewstate? Is it a value in the forms collections? I am trying to understand the mechanism of communication between the browser and the server. John Dalberg
0
9669
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
10426
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
10207
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
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
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
7537
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...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2913
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.