联系官方销售客服

1835022288

028-61286886

POSCMS 版主:POSCMS负责人
我使用ajax提交表单都时候提示模版不存在是什么情况
类型:POSCMS 更新时间:2018-04-23 11:12:38

我使用ajax提交表单都时候提示模版不存在是什么情况,返回个这玩意,

image.png

image.png



回帖
  • undefined
    #1楼    undefined
    2018-04-23 11:02:05
    0
    要知道在什么页面提交?最好贴上代码
  • 徐斌
    #2楼    徐斌
    2018-04-23 11:03:16
    0
    首页提交
    【undefined】1楼
  • 稻草人
    #3楼    稻草人
    2018-04-23 11:05:36
    0
    首页提交需要检查<form> 是怎么写的,你把index.html复制上来看看
  • 徐斌
    #4楼    徐斌
    2018-04-23 11:06:09
    0
    <script src="{HOME_THEME_PATH}lay/layer.js" charset="utf-8"></script><style media="screen"> .myformclass{ width: 400px !important; /* height: 420px */ min-height: 200px } .myform{ background: #fff; padding: 30px } .formtitle{ font-size: 20px; text-align: center; padding-bottom: 15px } .hui-item{ display: flex; flex-direction: row; align-items: center; padding: 10px 5px; border-bottom: 1px solid #eee; } .formb{ display: flex; flex-direction: row; justify-content: flex-end; padding: 10px 0 } .formbutton{ background: #fc7b26; color: #fff; border: none; border-radius: 2px; padding: 8px 20px; cursor: pointer; } .hui-item span{ width: 60px; font-size: 12px; color: #666 } .hui-item input{ border: none; flex: 1 } .layui-layer-title{ background: #fc7b26; color: #fff }</style><div class="myform" id="myform"><form method="post"><div class="hui-item"><span>姓名</span><input type="text" name="data[title]" value="" placeholder="您的姓名"></div><div class="hui-item"><span>电话</span><input type="text" name="data[dianhua]" value="" placeholder="您的手机号码"></div><div class="hui-item"><span>数量</span><input type="text" name="data[shuliang]" value="" placeholder="您要购买的邮箱个数"></div></form><div class="formb"><button type="button" class="formbutton" name="button" onclick="dr_submit()">提交</button></div></div> <script type="text/javascript"> function dr_layer(){ var html='<div class="myform" id="myform"><form method="post"><div class="hui-item"><span>姓名</span><input type="text" name="data[title]" value="" placeholder="您的姓名"></div><div class="hui-item"><span>电话</span><input type="text" name="data[dianhua]" value="" placeholder="您的手机号码"></div><div class="hui-item"><span>数量</span><input type="text" name="data[shuliang]" value="" placeholder="您要购买的邮箱个数"></div></form><div class="formb"><button type="button" class="formbutton" name="button" onclick="">提交</button></div></div>'; layer.open({ type: 1, title: '在线预定', closeBtn: 1, shadeClose: true, skin: 'myformclass', content: html }); } function dr_submit(){ $.ajax({ type: "POST", dataType:"json", url: '/index.php?c=form_cpyd', data: $('#myform').serialize(), success: function(json) { alert(json.code); } }); // // layer.closeAll(); // lay('预定成功,稍后我们会尽快与您联系!'); } function lay(msg){ layer.msg(msg); } </script>【稻草人】3楼
  • 徐斌
    #5楼    徐斌
    2018-04-23 11:06:53
    0
    <script src="{HOME_THEME_PATH}lay/layer.js" charset="utf-8"></script><style media="screen"> .myformclass{ width: 400px !important; /* height: 420px */ min-height: 200px } .myform{ background: #fff; padding: 30px } .formtitle{ font-size: 20px; text-align: center; padding-bottom: 15px } .hui-item{ display: flex; flex-direction: row; align-items: center; padding: 10px 5px; border-bottom: 1px solid #eee; } .formb{ display: flex; flex-direction: row; justify-content: flex-end; padding: 10px 0 } .formbutton{ background: #fc7b26; color: #fff; border: none; border-radius: 2px; padding: 8px 20px; cursor: pointer; } .hui-item span{ width: 60px; font-size: 12px; color: #666 } .hui-item input{ border: none; flex: 1 } .layui-layer-title{ background: #fc7b26; color: #fff }</style><div class="myform" id="myform"><form method="post"><div class="hui-item"><span>姓名</span><input type="text" name="data[title]" value="" placeholder="您的姓名"></div><div class="hui-item"><span>电话</span><input type="text" name="data[dianhua]" value="" placeholder="您的手机号码"></div><div class="hui-item"><span>数量</span><input type="text" name="data[shuliang]" value="" placeholder="您要购买的邮箱个数"></div></form><div class="formb"><button type="button" class="formbutton" name="button" onclick="dr_submit()">提交</button></div></div> <script type="text/javascript"> function dr_submit(){ $.ajax({ type: "POST", dataType:"json", url: '/index.php?c=form_cpyd', data: $('#myform').serialize(), success: function(json) { alert(json.code); } }); // // layer.closeAll(); // lay('预定成功,稍后我们会尽快与您联系!'); } function lay(msg){ layer.msg(msg); } </script>【稻草人】3楼
  • 功能插件开发
    #6楼    功能插件开发
    2018-04-23 11:09:06
    0
    <div class="myform" id="myform"><form  method="post"> 
    改成 
    
    <div class="myform"><form  method="post"  id="myform">
    满意答案
  • 稻草人
    #7楼    稻草人
    2018-04-23 11:09:34
    0
    这代码眼花缭乱!
  • 徐斌
    #8楼    徐斌
    2018-04-23 11:10:49
    0
    ????【功能插件开发】6楼
  • 功能插件开发
    #9楼    功能插件开发
    2018-04-23 11:11:14
    0
    应该不止这个地方,我始终感觉是哪里不对,少了什么代码
  • 老赵
    #10楼    老赵
    2018-04-23 11:11:48
    0
    这个对的,楼主是少了form代码【功能插件开发】6楼
  • 徐斌
    #11楼    徐斌
    2018-04-23 11:11:56
    0
    我错了,,现在可以了,,,我把id给放错地方了,,,欲哭无泪!!!!!【功能插件开发】6楼
  • 徐斌
    #12楼    徐斌
    2018-04-23 11:12:38
    0
    感谢大家给我解决此问题,我已经完美的解决