hwg-techniques archives | Mar 2002 | new search | results | previous | next |
id vs name in Form Tagsby "Steve Mount" <steve(at)saltyrain.com> |
|
I was curious how the id attribute would work in place of the name attribute in form tags, such as input type=text and type=checkbox. On a test form, I changed all name= references to id=, and loaded the page and submitted the form. I changed nothing else. The form's CGI said there was no data to process. Running the same copy, but with name= instead of id= works as expected. The reason I did this is that the XHTML spec [1] says that name is deprecated for id, and that eventually name will go away completely. Will this break forms all over the Internet? The spec also recommends using both the name and the id attributes, set identically, for forwards and backwards compatibility. I hate it when the spec says that. As if I don't have enough to remember. Any XHTML gurus have a comment? [1] http://www.w3.org/TR/xhtml1/ ------------------------------------------------------------- Steve Mount, Software Engineer steve(at)saltyrain.com Home Site http://www.saltyrain.com US Constitution Online http://www.usconstitution.net Free Your Soul http://www.anonymousconfession.com
HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA