How to set a default value to a Text list

Support General How to set a default value to a Text listResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33695
    jorgeazorinjorgeazorin
    Participant

    Is there any way to set a default value for a text list field?
    I've tried this way, but its not working.
    Thanks!!

    
    
    'id'         => 'additional_details_list',
                'name'       => 'Additional Details',
                'type'       => 'text_list',
                'columns'    => 12,
                'tab'        => 'details',
                'std'        => array(
                    'Distance'      => '24',
                    'Area' => '52',
                ),
                'clone'      => true,
                'sort_clone' => true,
                'options'    => array(
                    'Key' => 'key',
                    'Value' => 'value',
                ),
    
    
    #33765
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You can set the array of values as the default value of the text_list field. For example:

    [
        'id'      => 'text_list',
        'name'    => 'Text List',
        'type'    => 'text_list',
        'clone' => true,
        'options' => [
            'John Smith'      => 'Name',
            '[email protected]' => 'Email',
        ],
        'std' => [
            'Long Nguyen',
            '[email protected]'
        ]
    ]
    #33769
    jorgeazorinjorgeazorin
    Participant

    Thats working!!, Thanks!!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.