我想让他加载的时候就能用该怎么办呢,求大神指点 方法如下:(错误就是id缺少对象) function getYinshua(obj) { var pre=obj.id.split("_")[1]; var ysling = Number(document.getElementById("dg2_" + pre + "_txt_ling").value); //张 色令 txt_ling var ysP = Number(document.getElementById("dg2_" + pre + "_txt_YsP").value); //张 色 txt_YsP var seling = Number(document.getElementById("dg2_" + pre + "_TextBox3").value); //色令价 TextBox3 var qibanfei = Number(document.getElementById("dg2_" + pre + "_TextBox7").value); //起版费 TextBox7 var taoban = Number(document.getElementById("dg2_" + pre + "_txt_taoban").value); //套版 txt_taoban
var internalQiBanFei = Number(document.getElementById("dg2_" + pre + "_HidInternalQiBanFei").value); //内部起版费 HidInternalQiBanFei var internalSeLing = Number(document.getElementById("dg2_" + pre + "_HidInternalSeLing").value); //内部色令价 HidInternalSeLing if (taoban == 0) { document.getElementById("dg2_" + pre + "_HidPrintingDanXiang").value = 0; //印刷 内部单项费用 document.getElementById("dg2_" + pre + "_TextBox2").value = 0; //印刷 单项费用 TextBox2
} else { document.getElementById("dg2_" + pre + "_HidPrintingDanXiang").value = (Math.max(internalQiBanFei, ysling * ysP * internalSeLing)).toFixed(2); //印刷 内部单项费用 Add by Lebron in 2012-1-10 document.getElementById("dg2_" + pre + "_TextBox2").value = (Math.max(qibanfei, ysling * ysP * seling)).toFixed(2); //印刷 单项费用 TextBox2