[TYPO3-english] piVars, "[" & XHTML

Oliver Klee typo3-german-02 at oliverklee.de
Thu Jan 8 19:26:43 CET 2009


Hi Stephan,

Stephan Petzl schrieb:
> a lot of inputfields in TYPO3 FE extensions are named
> "tx_myextension_pi1[varname]". as far as i know in XHTML you have to
> assign the same value to the id attribute as to the name attribute
> at least if you need an id attribute.
> but when i assign "tx_myextension_pi1[varname]" to my fields id, i get
> following error by the XHTML validator:
> line 96 column 138 - Error: character "[" is not allowed in the value of
> attribute "id"

The "id" attribute indeed must not contain any brackets, while the
"name" attribute can have brackets without breaking XHTML validity (and
the ID need not necessarily be identical to the name).

An example: The name of a field could be "tx_myextension_pi1[name]" and
the ID of the very same element then could be "tx_myextension_pi1_name".

Best regards


Oliver


More information about the TYPO3-english mailing list