If I have the following form field (code below) how can I set the field as required within my model so that like other fields the form cannot be submitted without it containing information.
<?= $form->field($model, 'seo[seo_title]')->textInput(['maxlength' => 60])->label('SEO Title') ?>
Add the value
for te textinput in the options eg:
<?= $form->field($model, 'seo[seo_title]')->textInput(['maxlength' => 60], 'value'=> $yourValue )->label('SEO Title') ?>
or if you only need these fields required mark required in the model
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With