From: Ashley Sheridan

> Not sure if my other email got through earlier. Replacing the name
> attribute on form fields with the id one is not feasible at all. They
> don't even behave the same. What would happen if you had two forms on
> page that both had an element with the same name? Using the name
> attribute, everything is fine, but not so if you were using the id
> instead.

These conditions sound like a bugs to me. I can't imagine any reason why
different forms could have the same name or id. That applies to any set
of elements on a page. Each one must have a unique moniker, no matter
which attribute you use. Even the simple validations I use will complain
about your duplicates, as they should. Making them all unique also makes
it much simpler to use tools like Selenium or Silk Test to automate the
testing process.

Looking at the HTML 4.01 references given earlier in this thread, I see
that id is now a core attribute, i.e. it is available for all but a
handful of tags, while name is only available for the tags where it is
explicitly included. So it still appears to me that id is the preferred
attribute, as it is more generally available.

Bob McConnell

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to