Answer the question
In order to leave comments, you need to log in
How can I access the id of an input in a form from a controller?
There is a created form, each input in this form has its own id.
How can I get the id of the input in the controller?
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($updateForm, 'updateEx')->textInput(array('value'=>$item['name'], 'id' => $item['id']))->label('');?>
<a href="<?php echo Url::toRoute(['site/ex-delete', 'id' => $item['id']]) ?>" >Удалить</a>
<div class="form-group">
<?= Html::submitButton('Отправить', ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question