Home > Article > Backend Development > 为啥这个页面点“提交”没反应呢
为什么这个页面点“提交”没反应呢?
后台某页面index.html
<br /><html><br /> <head><br /> <script language="JavaScript" src="__PUBLIC__/backend/ueditor/ueditor.config.js" ></script><br /> <script language="JavaScript" src="__PUBLIC__/backend/ueditor/ueditor.all.js" ></script><br /> <script language="JavaScript" src="__PUBLIC__/backend/ueditor/ueditor.all.min.js" ></script><br /></head><br /><body><br /> <div class="wrap"><br /> <div class="nav"><br /> <ul class="cc"><br /> <li class="current"><a href="javascript:void(0);">网站基本信息</a></li><br /> </ul><br /> </div><br /> <form class="J_ajaxForm" id="J_Form" enctype="mutipart/form-data" method="post" action="{:U('Web/update')}" ><br /> <input type="hidden" name="nid" value="{$web.id}" /><br /> <div class="h_a"><?php if(empty($web)):?>新增<?php else:?>编辑<?php endif;?>网站</div><br /> <div class="table_full"><br /> <table width="100%" class="J_check_wrap"><br /> <col class="th" /><br /> <col width="400" /><br /> <col /><br /> <tr><br /> <th>网站名称</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" data-rules="{required:true}" value="{$web.webname}" name="name" /><br /> </td><br /> </tr><br /> <tr><br /> <th>网站标题</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" data-rules="{required:true}" value="{$web.webtitle}" name="title" /><br /> </td><br /> </tr><br /> <tr><br /> <th>网站关键字</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="60" class="input input_hd length_5" data-rules="{required:true}" value="{$web.webkeyword}" name="key" /><br /> </td><br /> </tr><br /><br /> <tr><br /> <th>网站网址</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" data-rules="{required:true}" value="{$web.weburl}" name="url" /><br /> </td><br /> </tr><br /><br /> <tr><br /> <th>公司名称</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" data-rules="{required:true}" value="{$web.comname}" name="cname" /><br /> </td><br /> </tr><br /> <tr><br /> <th>公司地址</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" data-rules="{required:true}" value="{$web.comaddress}" name="address" /><br /> </td><br /> </tr><br /> <tr><br /> <th>公司电话</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" data-rules="{required:true}" value="{$web.comtelnum}" name="tel" /><br /> </td><br /> </tr><br /> <tr><br /> <th>公司传真</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" data-rules="{required:true}" value="{$web.comfax}" name="fax" /><br /> </td><br /> </tr><br /> <tr><br /> <th>公司400电话</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" value="{$web.freephone}" name="phone" /><br /> </td><br /> </tr><br /> <tr><br /> <tr><br /> <th>公司邮箱</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" data-rules="{required:true}" value="{$web.comemail}" name="mail" /><br /> </td><br /> </tr><br /><br /> <tr><br /> <th>网站备案信息</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" data-rules="{required:true}" value="{$web.copyright}" name="right" /><br /> </td><br /> </tr><br /> <tr><br /> <th>客服QQ</th><br /> <td colspan="5"><br /> <span class="must_red">*</span><br /> <input type="text" maxlength="20" class="input input_hd length_5" data-rules="{required:true}" value="{$web.server_qq}" name="qq" /><br /> </td><br /> </tr><br /> <tr><br /> <th>网站内容</th><br /> <td colspan="5"><br /> <textarea id="editor" name="tont">{$web.new_notice}</textarea><script>UE.getEditor('editor');</script><br /> </td><br /> </tr><br /> </table><br /> <div class="btn_wrap"><br /> <div class="btn_wrap_pd"><br /> <button type="submit" class="btn btn_submit mr15">提交</button><br /> </div><br /> </div><br /> </div><br /> </form><br /> </div><br /><br /><include file="Home:Public:footer" /><br /><script type="text/javascript"><br /> BUI.use('bui/form', function(Form) {<br /> var form = new Form.HForm({<br /> srcNode: '#J_Form'<br /> });<br /> form.render();<br /> });<br /></script><br /><script type="text/javascript"><br /> $(function() {<br /> $(':checkbox').click(function() {<br /> $("#" + $(this).attr('pid')).attr('checked', true);<br /> $("#" + $(this).attr('gpid')).attr('checked', true);<br /> var id = $(this).attr('id');<br /><br /> var inputs = $('input[pid=' + id + ']');<br /> $(this).attr('checked') ? inputs.attr('checked', true) : inputs.attr('checked', false);<br /><br /> var ginputs = $('input[gpid=' + id + ']');<br /> $(this).attr('checked') ? ginputs.attr('checked', true) : ginputs.attr('checked', false);<br /> });<br /> });<br /></script><br /></body><br /></html><br />
<br /><?php<br /><br />class WebAction extends BaseAction {<br /><br /> /**<br /> * 显示在页面 smarty注入<br /> */<br /> public function index() {<br /> $this->checkAccess('team');<br />// $this->assign("news",$this->fNews());<br />// $this->fNews();<br />// $this->assign("oneNews",$this->fOneNews());<br /> $this->display();<br /> }<br /><br /> /**<br /> * 查询网站基本信息<br /> * @return Ambigous <mixed, string, boolean, NULL, unknown, multitype:, multitype:multitype: , void, object><br /> */<br /> public function find() {<br /> $this->checkAccess('team');<br /> $m = M("web");<br /><br /> $web = $m->find();<br /> $this->assign("web", $web); //赋值数据集<br /><br /> $this->display("Web/index");<br /> }<br /><br /> /**<br /> * 查询进入帮助中心显示的文章<br /> * @return Ambigous <mixed, string, boolean, NULL, unknown, multitype:, multitype:multitype: , void, object><br /> */<br /> public function fOneNews() {<br /> $this->checkAccess('team');<br /> $type['id'] = $_GET['id'] ? $_GET['id'] : 1; //二元运算 如果 存在$_GET['id'] 赋值本身 不存在为假赋值为1<br /><br /> $oneNews = M("news")->where($type)->select();<br /> return $oneNews; <br /> }<br /><br /> /**<br /> * 跳转到添加文章分类页面<br /> */<br /> public function create() {<br /> $this->checkAccess('team');<br /> $nType = new NewListAction();<br /> $webType = $nType->fNewsType();<br /> $this->assign("newsType", $webType);<br /> $this->display("News:newsFrom");<br /> }<br /><br /> public function update() { <br /><?php<br /><br />class WebAction extends BaseAction {<br /><br /> public function index() {<br /> $this->checkAccess('team');<br />// $this->assign("news",$this->fNews());<br />// $this->fNews();<br />// $this->assign("oneNews",$this->fOneNews());<br /> $this->display();<br /> }<br /><br /> public function find() {<br /> $this->checkAccess('team');<br /> $m = M("web");<br /><br /> $web = $m->find();<br /> $this->assign("web", $web); //赋值数据集<br /><br /> $this->display("Web/index");<br /> }<br /><br /> public function fOneNews() {<br /> $this->checkAccess('team');<br /> $type['id'] = $_GET['id'] ? $_GET['id'] : 1; //二元运算 如果 存在$_GET['id'] 赋值本身 不存在为假赋值为1<br /><br /> $oneNews = M("news")->where($type)->select();<br /> return $oneNews; <br /> }<br /><br /> public function create() {<br /> $this->checkAccess('team');<br /> $nType = new NewListAction();<br /> $webType = $nType->fNewsType();<br /> $this->assign("newsType", $webType);<br /> $this->display("News:newsFrom");<br /> }<br /><br /> public function update() { <br /> $this->checkAccess('team');<br /> $where['id'] = I('nid', '', 'trim'); //网站名称 <br /> <br /> $web['webname'] = I('name', '', 'trim'); //网站名称<br /> ...<br /> <br /> $add = M("Web");<br /> // $add->create($web) <br /> $result = $add->where($where)->save($web);<br /><br /> if ($result) { <br /> $this->success("操作成功!");<br /> } else { <br /> $this->error("操作失败");<br /> }<br /> }<br />}<br />
<br />[1,<br />2,<br />3,<br />]<br />