|
Posted by Troy Piggins on 02/06/06 00:32
* Jukka K. Korpela wrote:
> John Salerno <johnjsal@NOSPAMgmail.com> wrote:
>
>> If you're writing strict HTML 4.01, should you still use both the
>> id and name attribute, or is name good enough?
>
> The id and name attributes each have their own jobs, and the job varies
> especially as regards to the name attribute.
>
> You use id to assign a unique (within a document) identifier to an
> element. You use name to assign a name to a form field for the
> purposes of form submission (id won't do that), and maybe for some
> other purposes as well, for some elements.
>
>> I know name is deprecated in XHTML,
>
> It isn't. For form fields in particular, it is a necessity. It is
> deprecated in _some_ contexts, see
> http://www.w3.org/TR/html/#h-4.10
> (The heading there is misleading and part of the confusion:
> "The elements with 'id' and 'name' attributes". Surely an <input>
> element may have such attributes, and the name attribute is _not_
> deprecated there, and the use of id does _not_ replace name there.)
>
> In setting up a link destination, it is rather safe nowadays to use
> just the id attribute, in a suitable element. Browsers that only
> recognize <a name="..."> destinations have become rare.
I'm having a problem because of this - I have a form that is not working
correctly when I try to conform with strict xhtml by using "id" instead
of "name", but works fine but doesn't conform (according to the
w3c validator) if I use "name".
What's the solution to that? Adopt "Transitional" instead of "strict"?
--
Troy Piggins
Ubuntu 5.10 pkgs : kernel 2.6.12-9-386, postfix 2.2.4, procmail 3.22
Compiled from src : slrn 0.9.8.1/rt (score_color patch), mutt 1.5.11i
vim 6.4
Navigation:
[Reply to this message]
|