Let’s say you’re using a validator that doesn’t correspond to a specific field and you want to display it on the form. For example, I’m using the compare validator and wish the error summary to appear on the create form.

invite-error

[php]
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model frontend\models\Participant */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="participant-form">
<?php $form = ActiveForm::begin(); ?>

<?= $form->errorSummary($model); ?>

<p>Email address:</p>
[/php]

Support this site, share this page:Tweet about this on TwitterShare on RedditShare on LinkedInShare on FacebookEmail this to someone
  • Ajith

    nice tip

  • Сергей Сысоев

    Thank’s.

  • Hank Brown

    How to change the frickin text “Please fix the following errors”

  • tds

    Thanks, it’s working.

  • Rudman

    Thx. work’s fine.