[Typo3-dev] Setting a checkbox to checked by default
S. Teuber
traveler_in_time at gmx.net
Mon Jan 26 14:50:11 CET 2004
Hi,
I wonder if there's any way to define a checkbox as "checked" by default.
I defined an array of checkboxes in an extension like this:
ext_tables.php:
------------------- start --------------------
$tempColumns = Array (
'tx_myext_ft1' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:my_ext/locallang_db.php:pages.tx_myext_ft1',
'config' => Array (
'type' => 'check',
'cols' => 4,
'items' => Array (
Array('LLL:EXT:my_ext/locallang_db.php:pages.tx_myext_ft1.I.0', ''),
Array('LLL:EXT:my_ext/locallang_db.php:pages.tx_myext_ft1.I.1', ''),
Array('LLL:EXT:my_ext/locallang_db.php:pages.tx_myext_ft1.I.2', ''),
),
)
),
);
t3lib_div::loadTCA('pages');
t3lib_extMgm::addTCAcolumns('pages', $tempColumns, 1);
t3lib_extMgm::addToAllTCAtypes('pages', 'tx_myext_ft1');
------------------- stop ---------------------
Now I want one or all of these checkboxed to be checked by default, i.e.
if a new page record is created. I already tried to set the default-value
for the field in the database to "7" (all checked), but this didn't work.
Does anybody now if and how this is possible?
Sven
More information about the TYPO3-dev
mailing list