0

Am adding properties to the active form but it isn't working

Am using a wbranca's dynamic form that needs to pass a form id in the begin form and also in the same form there is a file uploader that requires'options' => ['enctype' => 'multipart/form-data'

I have tried 
 <?php $form = ActiveForm::begin(['id' => 'dynamic-form']
,['options' => ['enctype' => 'multipart/form-data']]); ?>
the form cant upload

When I interchange the two like below the form id is not rendered so the dynamic forms can't work

<?php $form = ActiveForm::begin['options' => ['enctype' => 'multipart/form-data'],
,(['id' => 'dynamic-form']]); ?>

1 Answer 1

3

In your code ;

<?php $form = ActiveForm::begin['options' => ['enctype' => 'multipart/form-data'],,(['id' => 'dynamic-form']]); ?>
  • You have not open bracket '(' after ActiveForm::begin.
  • 2 Comma used between form-data'],,(['id'
  • Unnecessary used '()' in 'id' part. And, didn't closed properly.

Use this. It will work

<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data'],'id' => 'dynamic-form']); ?>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.