Active Form yii2

In my project develop with yii 1.1.4, have this code working



	 * Performs the AJAX validation.

	 * @param Products $model the model to be validated


	protected function performAjaxValidation($model)


		if(isset($_POST['ajax']) && $_POST['ajax']==='products-form')


			echo CActiveForm::validate($model);






	echo '<div class="cart-view-table-front" id="view-cart">';

	echo '<h3>Il Menu che stai Ordinando</h3>';

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





now i Have update the code for Yii2

my view:


    'id' => 'product-form',

    'action' => Url::to(['products/uporder']),

    'enableAjaxValidation' => true,



If analyze the code with google crhome i have this error: Uncaught TypeError: jQuery(…).yiiActiveForm is not a function(…)

my file assets is:


namespace frontend\assets;

use yii\web\AssetBundle;


 * Main frontend application asset bundle.


class AppAsset extends AssetBundle


    //public $basePath = '@webroot';

    //public $baseUrl = '@web';

    public $sourcePath = '@bower/gaucho';

    public $css = [




    public $js = [

















    public $depends = [





I think is a dependency issue. Remove the js/jquery/jquery.min.js in the $js array and add this ‘yii\web\JqueryAsset’ in the $depends array.