我在事件onClick
上调用此函数function openGrpLifeStmtReport (busnsourceid,treatyId,policyid,productid,schemename,periodfrom,periodto,plcyeffdtfrom,polcyeffto,benType,exportTo,jasperName,jasperNamesum,reportvar1,reportvar2,reportvar3,reportvar4,userloged,clientId)
{
document.getElementById("reportvar1").value = document.getElementById("busnsourceid").value;
document.getElementById("reportvar2").value = document.getElementById("treatyId").value;
document.getElementById("reportvar4").value = document.getElementById("productid").value;
var Busnsourceid=document.getElementById(busnsourceid).value;
var TreatyID=document.getElementById(treatyId).value;
var PolicyID=document.getElementById(policyid).value;
var ProductID=document.getElementById(productid).value;
var SchemeName=document.getElementById(schemename).value;
var PeriodFrom=document.getElementById(periodfrom).value;
var PeriodTo=document.getElementById(periodto).value;
var plcyeffdtfrom=document.getElementById(plcyeffdtfrom).value;
var polcyeffto=document.getElementById(polcyeffto).value;
var BenType=document.getElementById(benType).value;
var exportTo=document.getElementById(exportTo).value;
var jasperName=document.getElementById(jasperName).value;
var jasperNamesum=document.getElementById(jasperNamesum).value;
var userloged=document.getElementById(userloged).value;
var clientId=document.getElementById(clientId).value;
var reportvar3;
var disorderby = document.getElementById("orderBy").value;
var disgroupby = document.getElementById("groupBy").value;
for (var form=0; form < document.forms.length; form++)
{
var what = document.forms[form];
for (var i=0, j=what.elements.length; i<j; i++)
{
if (what.reportvar3[i].checked == true)
{
reportvar3 = what.reportvar3[i].value;
break;
}
}
}
var url = "./GroupLifeAdvRep.do?action=customAction&innerAction=printGrpLifeRep&CedantCode="+Busnsourceid+"&TreatyID="+TreatyID+
"&Policy Id="+PolicyID+"&ProductID="+ProductID+"&SchemeName="+SchemeName+"&PeriodFrom="+PeriodFrom+"&PeriodTo="+PeriodTo+"&plcyeffdtfrom="+plcyeffdtfrom+"&polcyeffto="+polcyeffto+"&BenType="+BenType+"&exportTo="+exportTo+"&jasperName="+jasperName+"&jasperNamesum="+jasperNamesum+"&reportvar1="+reportvar1+"&reportvar2="+reportvar2+"&reportvar3="+reportvar3+"&reportvar4="+reportvar4+"&disorderby="+disorderby+"&disgroupby="+disgroupby+"&userloged="+userloged+"&clientId="+clientId;
window.open(url,"target","width=850, height=600, top=75, left=75, toolbar=0, menubar=0, location=0, status=0, scrollbars=1, resizable=1");
}
调用此函数的代码
<a href="#"><img src="Images/generatereport_btn.gif" alt="generatereport" border="0" onclick="openGrpLifeStmtReport('busnsourceid','treatyId','policyid','productid','schemename','periodfrom','periodto','plcyeffdtfrom','polcyeffto','benType','exportTo','jasperName','jasperNamesum','reportvar1','reportvar2','reportvar3','reportvar4','userloged','clientId')"/></a>
答案 0 :(得分:2)
的问题:
target
也可能是保留字试试
function openGrpLifeStmtReport (busnsourceid,treatyId,policyid,productid,schemename,periodfrom,periodto,plcyeffdtfrom,polcyeffto,benType,exportTo,jasperName,jasperNamesum,reportvar1,reportvar2,reportvar3,reportvar4,userloged,clientId) {
document.getElementById("reportvar1").value = document.getElementById("busnsourceid").value;
document.getElementById("reportvar2").value = document.getElementById("treatyId").value;
document.getElementById("reportvar4").value = document.getElementById("productid").value;
var Busnsourceid=document.getElementById(busnsourceid).value;
var TreatyID=document.getElementById(treatyId).value;
var PolicyID=document.getElementById(policyid).value;
var ProductID=document.getElementById(productid).value;
var SchemeName=document.getElementById(schemename).value;
var PeriodFrom=document.getElementById(periodfrom).value;
var PeriodTo=document.getElementById(periodto).value;
var plcyeffdtfrom=document.getElementById(plcyeffdtfrom).value;
var polcyeffto=document.getElementById(polcyeffto).value;
var BenType=document.getElementById(benType).value;
var exportTo=document.getElementById(exportTo).value;
var jasperName=document.getElementById(jasperName).value;
var jasperNamesum=document.getElementById(jasperNamesum).value;
var userloged=document.getElementById(userloged).value;
var clientId=document.getElementById(clientId).value;
var disorderby = document.getElementById("orderBy").value;
var disgroupby = document.getElementById("groupBy").value;
var reportvar3="";
var reportvars = document.getElementsByName("reportvar3");
for (var i=0; i < reportvars.length; i++) {
if (reportvars[i].checked) {
reportvar3 = reportvars[i].value;
break;
}
}
var url = "./GroupLifeAdvRep.do?action=customAction&innerAction=printGrpLifeRep&CedantCode="+Busnsourceid+"&TreatyID="+TreatyID+
"&Policy Id="+PolicyID+"&ProductID="+ProductID+"&SchemeName="+SchemeName+"&PeriodFrom="+PeriodFrom+"&PeriodTo="+PeriodTo+"&plcyeffdtfrom="+plcyeffdtfrom+"&polcyeffto="+polcyeffto+"&BenType="+BenType+"&exportTo="+exportTo+"&jasperName="+jasperName+"&jasperNamesum="+jasperNamesum+"&reportvar1="+reportvar1+"&reportvar2="+reportvar2+"&reportvar3="+reportvar3+"&reportvar4="+reportvar4+"&disorderby="+disorderby+"&disgroupby="+disgroupby+"&userloged="+userloged+"&clientId="+clientId;
window.open(url,"_blank","width=850,height=600,top=75,left=75,scrollbars,resizable");
return false; // cancel link
}
调用此函数的代码
<a href="#" onclick="return openGrpLifeStmtReport('busnsourceid','treatyId','policyid','productid','schemename','periodfrom','periodto','plcyeffdtfrom','polcyeffto','benType','exportTo','jasperName','jasperNamesum','reportvar1','reportvar2','reportvar3','reportvar4','userloged','clientId')"><img src="Images/generatereport_btn.gif" alt="generatereport" border="0" /></a>