Hello,
I need to make a form with some field editable for the creation (first time), but no more editable for update ('readonly'=>'readonly').
What is the best practice?
Thanks
Printable View
Hello,
I need to make a form with some field editable for the creation (first time), but no more editable for update ('readonly'=>'readonly').
What is the best practice?
Thanks
i found the solution :
Code:'config' => array
(
...
'onload_callback' => array
(
array('tl_rdv_group', 'onLoad')
),
...
Code:'fields' => array
(
'start_date' => array
(
...
'eval' => array( 'disabled'=> true, ...)
),
Code:
function onLoad( $dca ) {
...
if ( $_GET['s2e'] )
{
$GLOBALS['TL_DCA']['tl_rdv_group']['fields']['start_date']['eval']['disabled'] = false;
$GLOBALS['TL_DCA']['tl_rdv_group']['fields']['start_date']['eval']['datepicker'] = $this->getDatePickerString();
}
...
}