迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費且不限制商業(yè)使用,是免費開源的產品,以萬端互聯(lián)為設計理念,支持的微信公眾號、小程序、APP客戶端、移動端網站、PC網站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
我使用ajax提交表單都時候提示模版不存在是什么情況,返回個這玩意,
要知道在什么頁面提交?最好貼上代碼
首頁提交
【undefined】1樓
首頁提交需要檢查<form> 是怎么寫的,你把index.html復制上來看看
<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{
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{
flex: 1
.layui-layer-title{
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>數(shù)量</span><input type="text" name="data[shuliang]" value="" placeholder="您要購買的郵箱個數(shù)"></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>數(shù)量</span><input type="text" name="data[shuliang]" value="" placeholder="您要購買的郵箱個數(shù)"></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('預定成功,稍后我們會盡快與您聯(lián)系!');
function lay(msg){
layer.msg(msg);
</script>
【稻草人】3樓
<div class="myform" id="myform"><form method="post"> 改成 <div class="myform"><form method="post" id="myform">
????
【功能插件開發(fā)】6樓
應該不止這個地方,我始終感覺是哪里不對,少了什么代碼
這個對的,樓主是少了form代碼
我錯了,,現(xiàn)在可以了,,,我把id給放錯地方了,,,欲哭無淚?。。。。?/p>
要知道在什么頁面提交?最好貼上代碼
首頁提交
【undefined】1樓
首頁提交需要檢查<form> 是怎么寫的,你把index.html復制上來看看
<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>數(shù)量</span><input type="text" name="data[shuliang]" value="" placeholder="您要購買的郵箱個數(shù)"></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>數(shù)量</span><input type="text" name="data[shuliang]" value="" placeholder="您要購買的郵箱個數(shù)"></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('預定成功,稍后我們會盡快與您聯(lián)系!');
}
function lay(msg){
layer.msg(msg);
}
</script>
【稻草人】3樓
<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>數(shù)量</span><input type="text" name="data[shuliang]" value="" placeholder="您要購買的郵箱個數(shù)"></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('預定成功,稍后我們會盡快與您聯(lián)系!');
}
function lay(msg){
layer.msg(msg);
}
</script>
【稻草人】3樓
????
【功能插件開發(fā)】6樓
應該不止這個地方,我始終感覺是哪里不對,少了什么代碼
這個對的,樓主是少了form代碼
【功能插件開發(fā)】6樓
我錯了,,現(xiàn)在可以了,,,我把id給放錯地方了,,,欲哭無淚?。。。。?/p>
【功能插件開發(fā)】6樓