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

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

WBOY
Release: 2016-06-06 20:10:55
Original
827 people have browsed it

控制器renderAjax返回的

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

前端脚本

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

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

回复内容:

控制器renderAjax返回的

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

前端脚本

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template