hi,
i am newbie.
i am using ajax for my unique rule but when ajax is enable in the form
the submit button dosen’t work.
<?php $form = ActiveForm::begin([ ‘id’=> ‘form-register’,
//'enableClientValidation' => true,
'method' => 'post',
‘action’ => Url::to([‘registration/create’]),
‘enableAjaxValidation’ => true,
// ‘validateOnSubmit’=>true,
]
);?>
public function actionCreate()
{
$model = new Etablissement();
$mail = new Mail();
$users = new Users();
$tel = new Telephone();
if (Yii::$app->request->isAjax && $users->load(Yii::$app->request->post())) {
Yii::$app->response->format = Response::FORMAT_JSON;
return ActiveForm::validate($users);
}