[TYPO3-templavoila] Remove mapped attribute if empty

Rudy Gnodde (WIND Internet) rgn at windinternet.nl
Wed Aug 19 16:31:33 CEST 2009


Hello,

I've mapped the "checked" attribute of an input (type="checkbox"). In 
the XML I've set the field to a type check and use TypoScript to fill it 
if checked. This works fine, except that if the field isn't checked I 
get <input type="text" checked=""... which isn't valid and the resulting 
checkbox is checked.

So my question is: Is there any way to remove a mapped attribute if the 
value is empty?

The XML of the field is:

<field_checked type="array">
	<type>attr</type>
	<tx_templavoila type="array">
		<title>Geselecteerd</title>
		<sample_data type="array">
			<numIndex index="0"></numIndex>
		</sample_data>
		<eType>int</eType>
		<TypoScript>
			10 = CASE
			10.key.current = 1
			10.stdWrap.required = 1
			10.1 = TEXT
			10.1.value = checked
         	</TypoScript>
	</tx_templavoila>
	<TCEforms type="array">
		<config type="array">
			<type>check</type>
			<eval>int</eval>
			<default type="integer">0</default>
		</config>
		<label>Geselecteerd</label>
	</TCEforms>
</field_checked>

Regards,

Rudy


More information about the TYPO3-project-templavoila mailing list