Y
Y
Yuri Smirnov2018-02-12 23:30:01
Yii
Yuri Smirnov, 2018-02-12 23:30:01

How to remove validation scripts from renderAjax Yii2?

How to correctly display the form without scripts. they already exist or how to remove scripts when loading a form via Ajax, leaving ajax validation?
5a81f881488ca447559984.png
Getting the form via Ajax:

$('#msprofile').load('/shops', function(response){
   $('.selectpicker').selectpicker();
   $(me).parent().removeClass('active');
   $(me).tab('show');
});

In controller:
if(Yii::$app->request->isAjax){
   $model = new Shops();
   $model->load(Yii::$app->request->post());
   return $this->renderAjax('_msprofile.php', compact('model'));
}
return $this->render('shops');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OKyJIucT, 2018-02-13
@OKyJIucT

For example, like this yiiframework.ru/forum/viewtopic.php?t=21124
The form can be validated using the framework, including through ajax.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question