一个页面传值问题
我在一个页面 打开另一个子页面,在子页面上选取一个值,关闭的时候父页面的文本框已经显示了这个值,但在后台却调用不到,venname.text的值为“”,venname 是父页面文本框的id,是用aspx页面,
function GetSupplierList(temp) {
if (temp != "") {
temp = temp.split(",")
document.getElementById("ctl00_ContentPlaceHolder1_hfdSupplier").value = temp[0];
document.getElementById("ctl00_ContentPlaceHolder1_Supplier").value = temp[1];
alert(temp[1]);
}
}
这是我的父页面的方法,
function getCheck() {
t1 = "rpt1_ctl";
t2 = "_cboCode";
t3="";
var strRess = "";
for (i = 0; i < $("input[@type=checkbox]").length; i++) {
if ($("input[@type=checkbox]")[i].id.indexOf(t1) > -1 || $("input[@type=checkbox]")[i].id.indexOf(t2) > -1) {
if ($("input[@type=checkbox]")[i].checked == true) {
var tid = $("input[@type=checkbox]")[i].id;
//ctl00_ContentPlaceHolder1_rpt1_ctl05_Label2
// if(i.toString().length==1)
// {
t3 = "ctl00_ContentPlaceHolder1_ListView2_ctrl" + i + "_Label2";
// }
// else
// {
// t3="ctl00_ContentPlaceHolder1_rpt1_ctl"+i+"_Label2";
// }
strRess = $("label[@for=" + tid + "]").html()+","+document.getElementById(t3).innerHTML;
window.opener.GetSupplierList(strRess);
self.close();
}
}
}
}
这是子页面的方法