Home >Backend Development >PHP Tutorial >ajax 请求带有ActiveForm的页面,验证失效

ajax 请求带有ActiveForm的页面,验证失效

WBOY
WBOYOriginal
2016-06-06 20:10:55833browse

控制器renderAjax返回的

<code>return $this->renderAjax('form',[  'model' => $this->table,'id'=>0]);</code>

前端脚本

<code>$.get('/table/update',{id:id},function(t){
        if(t){
            $("#myModal").remove();
            $('body').append(t);
            $("#myModal").modal('toggle');
        }
    })</code>

请求回来验证都失效了,求助!!!

回复内容:

控制器renderAjax返回的

<code>return $this->renderAjax('form',[  'model' => $this->table,'id'=>0]);</code>

前端脚本

<code>$.get('/table/update',{id:id},function(t){
        if(t){
            $("#myModal").remove();
            $('body').append(t);
            $("#myModal").modal('toggle');
        }
    })</code>

请求回来验证都失效了,求助!!!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn