以下是示例圖:
以下是代碼:
復制代碼 代碼如下:
function forward()
{
//對發送內容拼接字符串,整理之後發送.
var temp = "";
var array = new Array();
$("#yxdwlb tr").each(function(){
var flag = false;
var user = "";
$(this).find("td").each(function(n){
if(n == 0){
//user = user + $(this).find("input").is(":checked") +"," ;
flag = $(this).find("input").is(":checked");
}
if(n == 1){ user = user + this.innerText + ",";}
if(n == 2){ user = user + $(this).find("input").val() + ",";}
if(n == 3){ user = user + $(this).find("input").is(":checked") + ",";}
if(n == 4){ user = user + $(this).find("input").is(":checked")+ ";";}
});//列
if(flag == true){
array.push(user);
}
});//行
for(var i = 0 ;i<array.length;i++)
{
temp = temp + array[i];//把數組的原素拼裝成字符串存入temp變量,
}
$("#array").val(temp);//temp變量存入參數array
//description不為空的判斷
var description=jQuery("#description").val();
if(trim(description)=='') {
triman.alert("請輸入描述內容!");
return;
}
//獲得表單內容並轉發
var doc = document.getElementById("document");
doc.action = "${pageContext.request.contextPath}/documentManager/save";
doc.method = "post";
doc.submit();
}