errorSummary on partial view


I have a partial viev (_search) inside my Index view so I’m able to filter data in the listview.

The ‘IP’ field inside the search form is required for this scenario (‘Log_Index’). If a user try to search the listview and he doesn’t select an IP an error should appear in the error summary of the search form.

the problem is that the error summary never appears.

this is a piece of code from the _search partial view:

<?php $form=$this->beginWidget('CActiveForm', array(




)); ?>

    <div style="clear:both">

        <p class="note">Fields with <span class="required">*</span> are required.</p>

        <?php echo $form->errorSummary(array($ip)); ?>




in the controller Index action I have:

$model=new Log('search');

$model->unsetAttributes();  // clear any default values

$user=new User;

$ip=new Usersip('Log_Index');











the above code seem to work well because it check correctly if I set the IP attribute or not.

with firebug i’m able to see that the returned code contain the errorSummary block that advice that IP field should not be null.

How can I display the errorSummary block on the page inside the partial view?

in not sure if i understand your case, but in your config file try add the following under components:










the Log you noticed in my code is a custom model and han nothing to do with the log message system.


showErrorSummary property of CForm class might be set false

the problem, I think is that the partial view _Search is rendered with the renderPartial method inside the main view Index and it doesn’t refresh correctly after the submit.

the problem is not of the renderPartial method.

I’ve put the CActiveForm widget inside the main view but the behavior is the same and the errorSummary doesn’t display.



and see what you get from it

its what CActiveForm actually does internally

also check to see if your $model variable is actually set

I echoed it after


and the result from firebug is:

<div class="errorSummary"><p>Per favore, correggere i seguenti errori di input:</p>


<li>Ip non può essere nullo.</li>


the same div message that I only can see on the page only with firebug.


I’ve tried with yii but definitely I cannot make it work correctly.

So I switched out to the old jquery validation using the jquery.validate plugin.

this is the js script I used on the index view:

<script type="text/javascript" charset="utf-8">

    $(document).ready(function() {


           errorElement: "div",

           rules: {

               'Usersip[IP]' : "required"


           messages: {

               'Usersip[IP]' : 'è necessario selezionare un IP'


            submitHandler: function(form) {

               $.fn.yiiListView.update('log-view', {

		data: $(this).serialize()


                return false;





I wish Merry Christmas to all Yii people.