File data is not appearing

Created on 15 July 2024, 9 months ago

I am using below code in drupal 10 form

 $form['post_upload_files'] = [
      '#type' => 'dropzonejs',
      '#title' => $this->t('Upload Files'),
      //'#description' => $this->t('Upload multiple files, including images and documents.'),
    ];

I am not getting value after file upload in form_state

  public function submitFormAjax(array &$form, FormStateInterface $form_state) {
    $response = new AjaxResponse();
      //$name = $form_state->getValue('name');
      $files = $form_state->getValue('post_upload_files');
     return $response;
}

$files variable value is coming with empty array even after file upload

🐛 Bug report
Status

Active

Version

2.10

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024