我有這種形式鏈接到發佈PHP提交彈出秀後再次
<form action="newsletter.php" method="post" >
<input type="text" name="name" id="wd1_nlpopup_name" placeholder="Name" value="" class="textinput" tabindex="500">
<input type="text" name="email" id="wd1_nlpopup_mail" placeholder="Your email" value="" class="textinput" tabindex="501">
<input type="submit" name="submit" class="btn btn-orange btn-large" value="Submit" id="submit">
</form>
和該JavaScript文件,彈出形式
jQuery(document).ready(function($){
var wd1_nlpopup_expires = $("#wd1_nlpopup").data("expires");
var wd1_nlpopup_delay = $("#wd1_nlpopup").data("delay") * 1000;
$('#wd1_nlpopup_close').on('click', function(e){
$.cookie('wd1_nlpopup', 'closed', { expires: wd1_nlpopup_expires, path: '/' });
$('#wd1_nlpopup,#wd1_nlpopup_overlay').fadeOut(200);
e.preventDefault();
});
$('#submit').on('submit', function(e){
$.cookie('wd1_nlpopup', 'submited', { expires: wd1_nlpopup_expires, path: '/' });
$('#wd1_nlpopup,#wd1_nlpopup_overlay').fadeOut(200);
e.preventDefault();
});
if($.cookie('wd1_nlpopup') != 'closed' || 'submited'){
setTimeout(wd1_open_nlpopup, wd1_nlpopup_delay);
}
當數據被submited數據是在MySQL數據庫中,但彈出顯示我再次嘗試使用onsubmit
與功能,但結果相同或彈出不`噸,但顯示的數據是不是在database.Thank你
你有沒有考慮過改變你的邏輯後使用AJAX的形式? – SeanKendle
當你在最後的if語句之前執行console.log(「wd1_nlpopup」,$ .cookie('wd1_nlpopup'))時,你會得到什麼? – SeanKendle
'e.preventDefault();'阻止提交表單。至少如果您希望它實際發佈表單,請刪除該行。 – SeanKendle