Home > php教程 > php手册 > 简单列表页全选删除

简单列表页全选删除

WBOY
Release: 2016-06-07 11:45:24
Original
1080 people have browsed it

三步搞定全选删除
//action中调用<br>          $user=M('User');<br>         $base=A('Base');<br>         $user->deleteall($staff);    //全选删除函数<br> public function deleteall($mouldel){<br>  @extract($_POST);<br>  $counts=count($id);<br>  for($i=0;$i  {<br>  $mouldel->where('id="'.$id[$i].'"')->delete();        <br>  }<br>  if($counts)<br>  {<br>      $this->success("删除成功");<br>  }<br>  else<br>  {<br>      $this->error("删除失败");<br>  }    <br> }模板中js部分
function unselectall(){
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.chkAll.checked&0;
}
}
function CheckAll(form){
for (var i=0;i

var e = form.elements[i];
if (e.Name != 'chkAll'&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}
html







删除

AD:真正免费,域名+虚机+企业邮箱=0元

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template