在wordpress中提交表单后,会话值变为null

时间:2017-02-28 05:46:01

标签: javascript php jquery wordpress forms

我在wordpress工作。我正在使用javascript提交表单。我的javascript代码提交表单。

 jQuery(document).ready(function($){
window.submitpassengerdetail = function() {
    var form;
    form = document.createElement("form"); // CREATE A NEW FORM TO DUMP ELEMENTS INTO FOR SUBMISSION
    form.method = "post"; // CHOOSE FORM SUBMISSION METHOD, "GET" OR "POST"
    form.action = "<?php echo get_permalink(346);?>"; // TELL THE FORM WHAT PAGE TO SUBMIT TO
    jQuery(".details-passenger").children().each(function () { // GRAB ALL CHILD ELEMENTS OF <TD>'S IN THE ROW IDENTIFIED BY idRow, CLONE THEM, AND DUMP THEM IN OUR FORM
        $(this).clone().appendTo(form);
    });
    form.style.display = "none";
    document.body.appendChild(form);
    form.submit(); // NOW SUBMIT THE FORM THAT WE'VE JUST CREATED AND POPULATED
}

});

将表单提交到get_permalink(346)后,我在提交表单之前的上一页中设置了会话值null。会话已设置但值变为空。可能是什么原因。谢谢。

0 个答案:

没有答案