我有一个调度应用程序,用户可以单击表格字段,它将在新页面中打开一个带有适当发布数据的表单。我的用户认为这非常困难,现在需要查看时间表并且表单是一个弹出窗口,以便他们可以同时看到两者。我的表单弹出窗口正常工作,但我的函数没有传递帖子数据。这是代码:
$(".main td:not(.jobCell):not(.tJCell)").click(function()
{
var roleID = document.getElementById('roleID').value;
var notDept = $('.deptSelect').val();
var myDept = $('#myDept').val();
var $this = $(this);
var colIndex = $this.cellPos().left;
var preCol = colIndex % 2;
if (myDept != notDept)
{
return;
}
if (preCol == 0)
{
colIndex = colIndex /2;
}
else
{
colIndex++;
colIndex = colIndex /2;
}
var row = $this.parent('tr').contents('th:eq(0)').html();
var departmentID = $(".deptSelect").val();
var headerObj = $(this).parents('.main').find('th').eq(colIndex);
var toPass = $.trim(headerObj.text());
var picked = $("#picked").val();
var testDate = new Date(picked + " " + row);
var today = new Date();
var today = new Date(today - 2*60*60*1000);
if (testDate < today)
{
if (roleID > 2)
{
alert (today);
alert("You Cannot Schedule a New Job in the Past!");
}
return;
}
var thisForm = '';
if (roleID == 5)
{
thisForm = '../forms/tentativeJobForm.php';
}
else
{
thisForm ='../forms/newJobForm.php';
}
var f = document.createElement("form");
f.setAttribute('class','jobTime');
f.setAttribute('method','post');
f.setAttribute('action',thisForm);
var iii = document.createElement('input');
iii.setAttribute('type','hidden');
iii.setAttribute('name','departmentID');
iii.setAttribute('value',departmentID);
f.appendChild(iii);
var i = document.createElement('input');
i.setAttribute('type','hidden');
i.setAttribute('name','sTime');
i.setAttribute('value',picked + " " + row);
f.appendChild(i);
var ii = document.createElement('input');
ii.setAttribute('type','hidden');
ii.setAttribute('name','ast');
ii.setAttribute('value',toPass);
f.appendChild(ii);
document.getElementsByTagName('body')[0].appendChild(f);
if (roleID > 2)
$('.jobTime').onsubmit(window.open(thisForm,null,"height=550,width=900,toolbar=0,menubar=0,location=100,status=no,scrollbars=1,resizable=1,right=300,top=100"));
//$('.jobTime').submit();
else
return;
});
我知道该功能没有发布数据,所以我的问题是“如何获得使用发布数据打开弹出表单的功能?”