By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,379 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,379 IT Pros & Developers. It's quick & easy.

legal form names

P: n/a
What's required of a form element name?

I can't seem to fathom this from the W3C:

http://www.w3.org/TR/REC-html40/inte...l#control-name

It looks like anything at all is a good name.

I'm a bit leary of switching over to id's only, call me old fashioned.

Jeff


Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Jeff Thies wrote:
What's required of a form element name?

I can't seem to fathom this from the W3C:

http://www.w3.org/TR/REC-html40/inte...l#control-name
I suppose you already know that it's cdata:

http://www.w3.org/TR/REC-html40/types.html#type-cdata
It looks like anything at all is a good name.
Not everything, but a good deal. Still, there are some things I would
not do to avoid confusion down the road. For example, I'd not put
punctuation in a name. I also prefer all lowercase.
I'm a bit leary of switching over to id's only, call me old fashioned


Unless I've missed something, I don't think one has anything to do
with the other in the context of forms. The name attribute of a form
element specifies the name submitted with the same element's value.
The id is a unique identifier for e.g. an html document. It is never
submitted, even when it is included in a form element.

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Jul 20 '05 #2

P: n/a
> > What's required of a form element name?

I can't seem to fathom this from the W3C:

http://www.w3.org/TR/REC-html40/inte...l#control-name
I suppose you already know that it's cdata:

http://www.w3.org/TR/REC-html40/types.html#type-cdata


Thanks. I found that somewhat later.

I seem to recall that either "-" or "_" at one time did not work as some
type of cdata, either classes or id's.

Do you know what that might have been, and what it failed in?

Jeff
It looks like anything at all is a good name.


Not everything, but a good deal. Still, there are some things I would
not do to avoid confusion down the road. For example, I'd not put
punctuation in a name. I also prefer all lowercase.
I'm a bit leary of switching over to id's only, call me old fashioned


Unless I've missed something, I don't think one has anything to do
with the other in the context of forms. The name attribute of a form
element specifies the name submitted with the same element's value.
The id is a unique identifier for e.g. an html document. It is never
submitted, even when it is included in a form element.

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Jul 20 '05 #3

P: n/a
"Jeff Thies" <no****@nospam.net> wrote:
I seem to recall that either "-" or "_" at one time did not work
as some type of cdata, either classes or id's.


Technically class is CDATA in the DTD, but that's just because SGML
(not to mention XML) is too limited in describing the syntax of
attribute values. The prose of the specification says that class
attribute's value shall be a space-separated list of class names.
Somewhat strangely, the HTML specification does not define the syntax
of class names, but it is natural to expect them to obey normal syntax
of names in HTML. This permits "-" and "_" among other things.
According to CSS specifications, the range of characters permitted in
class names is much wider, but I wouldn't rely on such things.
(See http://www.w3.org/TR/CSS2/syndata.ht...def-identifier )

Id attributes are declared as ID, which imposes specific syntax.

Special characters in different names may cause problems for reasons
external to CSS. If the name of a form field contains "-" or "_", then
problems may arise if the form handler cannot deal with them. But then
the question is what the form handler can do, rather than what HTML
syntax permits.

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

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.