December 02 2015

Yii2 cactiveform client validation not working with fancybox ajax

Tagged Under :

Yii
If using fancybox ajax display the Yii2 cactiveform you will found that the client validation are not working.

Its due to the form ID was invalid or duplicated in same page. what you need to do is assign a new form id inside cactiveform.

Example
$form = ActiveForm::begin([
  'enableClientValidation' => true,
  'id' => 'new_form_id'
]);

Make a Comment

You must be logged in to post a comment.