I am wanting to know whether [ and ] are XHTML1-valid characters for use
within an id attribute and/or a name attribute.
(e.g. see line 77) suggests that it is valid, but the spec suggests that
it is not.
More detail:
I have a form containing a variety of input elements, including a checkbox
array.
For ease of processing the form, it would be helpful if the name of each
element in the checkbox array could include [ ] e.g.
<input type="checkbox" name="formname[checkbox][number]" />
However, looking at the HTML4 spec, which XHTML1.0Transit ional piggy-backs
onto, the specification suggests that [ and ] are not valid characters for
use within this:
"ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens ("-"),
underscores ("_"), colons (":"), and periods (".")."
However, a page I have online at present which uses [ ] does validate to
XHTML1.0Transit ional:
eg. line 77 contains name="main[function]"
Is [ and ] therefore valid?
Martin Lucas-Smith www.geog.cam.ac.uk/~mvl22
Comment