Calling Javascript from dynamic form button in yii2
问题 In Yii2 Dynamic form, I have add-item and remove-item button to add a new row or remove a particular row. What I want is to call a javascript function on click of the remove item button. Dynamic Form Code - <?= $form->field($modelsProductsales, "[{$i}]productname")->widget(Select2::classname(), [ 'data' => ArrayHelper::map(Productbatch::find()->orderBy('productname')->all(),'productname','productname'), 'language' => 'en', 'options' => ['placeholder' => 'Select Product', 'onchange' =>