how do i set the default field in my form ?

Created on 13 December 2023, about 1 year ago

Problem/Motivation

I created a form like this and it successfully sets the various emails into the configuration file, but when i try to set the default value it, gets an array back. how do i set the default value for this multivalue field?

$form['comment']['comment_admin_notify_mailto'] = array(
      '#type' => 'multivalue',
      '#title' => $this->t('Comments Topics And Post Approvers'),
      '#cardinality' => MultiValue::CARDINALITY_UNLIMITED,
      'comment_admin_notify_mailto' => [
        '#type' => 'textfield',
        '#title' => $this->t('Person to send notifications for Comments, Topics and Posts'),
        '#default_value' =>  vista_moderation_admin_notify_variable_get_site_email(),
 
      ],
    );

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Active

Version

2.0

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States dianacastillo Miami

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024