name/id, forms, and XHTML

by Greg Hart <ghhart(at)earthlink.net>

 Date:  Tue, 08 Oct 2002 14:23:26 -0400
 To:  hwg-techniques(at)mail.hwg.org
  todo: View Thread, Original
I've read repeatedly that in converting from HTML to XHTML, you must at 
least replace "name" with "id", or to keep older browsers happy, have both 
present. I've also read in a few places that they have to be the same 
value. Simple enough, until you get to elements such as checkboxes, radio 
buttons, and the like, which before had to share the same "name" value.
So my question is, on form items where normally the name would have been 
the same to group them, is this an unnecessary thing now, and we can name 
them "orderitem1", "orderitem2", etc? And how does the form know they are 
grouped, and should show up on the email side together (using Matt's 
FormMail.cgi)? One example is where I'd have 20 or more checkboxes, 
previously all marked as name="Purchase"...before, I'd see the incoming 
order as Purchase: Item1, Item2, Item3, etc. Common sense tells me that if 
I lose the name altogether, the script I had been using should break. I 
haven't actually tested this theory yet, because the same issue is breaking 
my JS as well.
Also, what browsers will be a problem and won't see the "id", requiring the 
"name" be left in to process the form?
Just trying to get a handle on what the best way(s) to work forms are in 
XHTML...
-Greg 

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA