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

Peter Klein peter at umloud.dk
Thu Jan 8 15:40:31 CET 2009


Hi Stephan.

ID comprises only alpha numeric characters, and hyphens. They cannot
include underscores and other characters, nor spaces. An ID cannot
begin with a numeral.

That's why you get an error if you use the "[ ]" brackets.

TYPO3 requires the "[ ]" brackets to distinguish between different
extensions, so you are stuck with the name attributes.

If you make your pages XHTML strict, and omits the name attribute,
then you risk that in some browsers (IE below version 6 and others),
no data is submitted, due to the name attribute is missing.

I suggest you make the page XHTML transitional, which still allows the
name attribute.

There might also be problems if you use a selectbox with multiselect,
as then you normally sets the name to something like this (Notict the
last set of square brackets, which is not TYPO3 specific.)

name="tx_myextension_pi1[varname][]"

--
Peter Klein / Umloud Untd.


On Thu, 08 Jan 2009 14:56:20 +0100, Stephan Petzl <spetzl at gmx.at>
wrote:

>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"


More information about the TYPO3-english mailing list