Yii - Using Ajax Validation -
i'm trying enable ajax validation in form, i've added right parameters form, it's not working, here's code:
<?php $form=$this->beginwidget('cactiveform', array( 'id'=>'user-form', 'enableajaxvalidation'=>true, 'htmloptions' => array( 'enctype' => 'multipart/form-data', 'enableclientvalidation'=>true ), )); ?> please advice.
in top of action, add following lines:
if(isset($_post['ajax']) && $_post['ajax']==='user-form'){ echo cactiveform::validate($model); yii::app()->end(); }
Comments
Post a Comment