W3C home > Mailing lists > Public > www-html-editor@w3.org > July to September 2006

Re: Using 'name=' in Form elements - Why not?

From: Toby Inkster <usenet200608@tobyinkster.co.uk>
Date: Tue, 15 Aug 2006 08:06:15 +0100
To: www-html-editor@w3.org
Message-Id: <20060815070615.71EEF944E8@ophelia.g5n.co.uk>

Ed Jay wrote:

> My pages won't validate, because I use the 'name' attribute in <form>.

The 'name' attribute *is* allowed on 'form' elements in HTML. However, in
XHTML 1.0, there seems to be an error in the DTD.

The XHTML 1.0 Recommendation, Second Edition, section 4.10 states:

	| HTML 4 defined the name attribute for the elements a, applet, 
	| form, frame, iframe, img, and map. [...] Note that in XHTML 1.0,
	| the name attribute of these elements is formally deprecated.

And in Appendix C.8:

	| Note that XHTML 1.0 has deprecated the name attribute of the a,
	| applet, form, frame, iframe, img, and map elements.
	
However, the Transitional DTD has:

	| <!ATTLIST form
	|   %attrs;
	|   action      %URI;          #REQUIRED
	|   method      (get|post)     "get"
	|   enctype     %ContentType;  "application/x-www-form-urlencoded"
	|   onsubmit    %Script;       #IMPLIED
	|   onreset     %Script;       #IMPLIED
	|   accept      %ContentTypes; #IMPLIED
	|   accept-charset %Charsets;  #IMPLIED
	|   >

Whereas the First Edition Transitional DTD had:

	| <!ATTLIST form
	|   %attrs;
	|   action      %URI;          #REQUIRED
	|   method      (get|post)     "get"
	|   name        NMTOKEN        #IMPLIED
	|   enctype     %ContentType;  "application/x-www-form-urlencoded"
	|   onsubmit    %Script;       #IMPLIED
	|   onreset     %Script;       #IMPLIED
	|   accept      %ContentTypes; #IMPLIED
	|   accept-charset %Charsets;  #IMPLIED
	|   target      %FrameTarget;  #IMPLIED
	|   >

A bunch of 'target' attributes also seem to have disappeared from
Transitional between First and Second Editions. 

I'm CCing the W3C's HTML Editor in this message. Perhaps some clarification
is needed in the errata?

That said, if you're using XHTML, you should probably be moving away from
deprecated features like the 'name' attribute. Use 'id' instead.

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me  ~ http://tobyinkster.co.uk/contact
Received on Wednesday, 16 August 2006 15:45:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:17:55 GMT