-
床上用品類網(wǎng)站pbootcms模...
-
潮流資訊信息類網(wǎng)站pb...
-
數(shù)控車床類網(wǎng)站pbootcms模...
-
自動化儀表流量計智能水...
-
戶外露營設(shè)備類網(wǎng)站pb...
-
電子產(chǎn)品類網(wǎng)站pbootcms模...
-
協(xié)議合同類網(wǎng)站pbootcms模...
-
日用百貨外貿(mào)類網(wǎng)站pb...
-
創(chuàng)業(yè)資訊文章博客類網(wǎng)站...
-
機(jī)械電子產(chǎn)品類網(wǎng)站pb...
-
園林花卉種植類網(wǎng)站pb...
-
減速機(jī)設(shè)備類外貿(mào)網(wǎng)站...
-
塑膠板材類網(wǎng)站pbootcms模...
-
五金配件加工機(jī)械設(shè)備類...
-
玩具動漫類網(wǎng)站pbootcms模...
-
茶葉資訊類網(wǎng)站pbootcms模...
-
金融資本咨詢推廣落地頁...
-
合同范文類網(wǎng)站pbootcms模...
-
五金機(jī)械加工設(shè)備類網(wǎng)站...
-
酒店管理系統(tǒng)類網(wǎng)站pb...
Ajax提交<form onsubmit="return submsg(this);">
聯(lián)系人<input type="text" name="contacts" required id="contacts">
手 機(jī)<input type="text" name="mobile" required id="mobile">
內(nèi) 容<textarea name="content" id="content"></textarea>
驗證碼<input type="text" name="checkcode" required id="checkcode">
<img title="點(diǎn)擊刷新" src="{pboot:checkcode}" onclick="this.src='{pboot:checkcode}?'+Math.round(Math.random()*10);" />
<button type="submit">提交留言</button>
</form>
<script>
//ajax提交留言,由于涉及到提交地址標(biāo)簽的解析,JS需要放在html文件中
function submsg(obj){
var url='{pboot:msgaction}'; //如果是自定義表單則使用地址{pboot:form fcode=*}
var contacts=$(obj).find("#contacts").val();
var mobile=$(obj).find("#mobile").val();
var content=$(obj).find("#content").val();
var checkcode=$(obj).find("#checkcode").val();
$.ajax({
type: 'POST',
url: url,
dataType: 'json',
data: {
contacts: contacts,
mobile: mobile,
content: content,
checkcode: checkcode
},
success: function (response, status) {
if(response.code){
alert("謝謝您的反饋,我們會盡快聯(lián)系您!");
$(obj)[0].reset();
}else{
alert(response.data);
}
},
error:function(xhr,status,error){
alert('返回數(shù)據(jù)異常!');
}
});
return false;
}
</script>


