我试图在发生某个页面事件时触发表单数据的临时发送,允许在用户离开页面时捕获表单数据。提交的所有表单数据将与已完成的订单列表进行比较,并按完成的顺序进行整理,哪些是部分的。这是否可以使用表单数据发送会话变量?
<script>
function doAjaxPost() {
var orderSubTotal = '';
var orderTotal = '';
var numOfItems = '';
var items = new Array('');
var ids = new Array('');
var codes = new Array('');
var qtys = new Array('');
var price = new Array('');
var orderTax = '';
var orderShipping = '';
var appliedPromoIdList = '';
var coupon = '';
var storeId = '';
var activeShipPromotionCount = '';
var itemImages = new Array('');
var custEmail = '';
var custFName = '';
var custLName = '';
$.ajax({
type: "POST",
url: "interim-cart-viewer.php",
data: "",
error: function (e) {
alert('Error: ' + e);
}
});
} document.getElementById("billing-email").on("change", doAjaxPost()); </script>
<strong>
Email Address:</strong>
<input type="text" class="text" name="miscDS.shopperEmailAddress" id="billing-email" size="40" maxlength="99" value="" />