Results 1 to 2 of 2

Thread: [solved] Disable field at update only

  1. #1
    User
    Join Date
    11-23-09.
    Location
    Valais, Switzerland
    Posts
    77

    Default [solved] Disable field at update only

    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

  2. #2
    User
    Join Date
    11-23-09.
    Location
    Valais, Switzerland
    Posts
    77

    Default Re: Disable field at update only

    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();
        }
    ...
     }

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •