Here’s a small tip on how to create a hidden field in an active record form, within the model:

<?php $form = ActiveForm::begin(); ?>

<?= $form->field($model, ‘fullname’)->textInput([‘maxlength’ => true]) ?>

/* Example of hiddenInput for an ActiveRecord Active $form->field */
<?= $form->field($model, ‘state’)->hiddenInput([‘value’=> $src->state])->label(false);?>

<?= $form->field($model, ‘position_str’)->textInput([‘maxlength’ => true]) ?>

<?php ActiveForm::end(); ?>

Support this site, share this page:Tweet about this on Twitter

Twitter

Share on Reddit

Reddit

Share on LinkedIn

Linkedin

Share on Facebook

Facebook

Email this to someone

email