Yii2: ajax form validation on an ajax submitted form

后端 未结 2 521
滥情空心
滥情空心 2021-02-01 09:28

I\'m wondering if any Yii2 experts can help me understand how best to work with ajax forms combined with Yii ajax validation. I think I can explain the issue without taking you

2条回答
  •  时光说笑
    2021-02-01 09:35

    You should set up validationUrl with a different URL compared to the URL that you are submitting the form to. In this way you can have the validation function that would validate and return the return ActiveForm::validate($model); and the normal submit form that does something else.

    You can read more about validationUrl here:

提交回复
热议问题