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

Stephan Petzl spetzl at gmx.at
Fri Jan 9 15:33:06 CET 2009


Peter Klein schrieb:
> 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"

oh sorry, dont know where i have this nonsence from. i think one day i 
had this kind of error in my firefox validation extension (that name and 
id have to be named equally).
thanks for your help!


More information about the TYPO3-english mailing list