Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>the problem was fixed by my bro seenivasan on Yii Forum , so I will share the code here </p> <p>_form.php</p> <pre><code>&lt;?php $form=$this-&gt;beginWidget('CActiveForm', array( 'id'=&gt;'section-form', 'enableAjaxValidation'=&gt;true, //'enableClientValidation'=&gt;true, 'clientOptions'=&gt;array('validateOnSubmit'=&gt;true), //This is very important )); ?&gt; &lt;p class="note"&gt;Fields with &lt;span class="required"&gt;*&lt;/span&gt; are required.&lt;/p&gt; &lt;?php echo $form-&gt;errorSummary($model); ?&gt; &lt;div class="row"&gt; &lt;?php echo $form-&gt;labelEx($model,'name'); ?&gt; &lt;?php echo $form-&gt;textField($model,'name',array('size'=&gt;60,'maxlength'=&gt;64)); ?&gt; &lt;?php echo $form-&gt;error($model,'name'); ?&gt; &lt;/div&gt; &lt;div class="row buttons"&gt; &lt;?php echo CHtml::submitButton($model-&gt;isNewRecord ? 'Create' : 'Save'); ?&gt; &lt;/div&gt; &lt;?php $this-&gt;endWidget(); ?&gt; </code></pre> <p>In controller</p> <pre><code>public function actionCreate() { $model=new Section; // Uncomment the following line if AJAX validation is needed $this-&gt;performAjaxValidation($model);//You have enabled ajax validation. You have to uncomment this line. if(isset($_POST['Section'])) { $model-&gt;attributes=$_POST['Section']; if($model-&gt;save()) $this-&gt;redirect(array('view','id'=&gt;$model-&gt;id)); } if(Yii::app()-&gt;request-&gt;getIsAjaxRequest()) echo $this-&gt;renderPartial('_form',array('model'=&gt;$model),true,true);//This will bring out the view along with its script. else $this-&gt;render('create',array( 'model'=&gt;$model, )); } </code></pre> <p>Reference link :</p> <p><a href="http://www.yiiframework.com/forum/index.php/topic/38740-load-view-with-fancybox/page__p__186260__fromsearch__1#entry186260" rel="nofollow noreferrer">Yii Forum </a></p> <p><img src="https://i.stack.imgur.com/rZdv8.png" alt="Fancy Box "></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload