<script language="javascript" type="text/javascript">
//选择物料
function opendata1(strUrl) {
var aa = window.showModalDialog(strUrl, window, 'dialogWidth:1030px;dialogHeight:500px;center:yes;status:no;dialogWidth:1030px;dialogHeight:500px');
if (aa != null)
{
var cc = new Array();
cc = aa.split('|');
var theform = document.forms[0];
theform.elements["tb_matno"].value = cc[0];
theform.elements["tb_mname"].value = cc[1];
theform.elements["tb_szno"].value = cc[2];
theform.elements["tb_jx"].value = cc[3];
theform.elements["tb_spname"].value = cc[4];
theform.elements["tb_tongym"].value = cc[5];
theform.elements["tb_munit"].value = cc[6];
theform.elements["tb_munit1"].value = cc[7];
theform.elements["tb_produce"].value = cc[8];
theform.elements["tb_cxtj"].value = cc[9];
theform.elements["tb_zl"].value = cc[10];
theform.elements["tb_orgn_code"].value = cc[11];
}
return false;
}
</script>
上面的代码中,我要为各个控件赋值,前面三个可以取得,后面的就怎么也赋不进去,前提是CC[*]都是有值的,请各位帮忙,是为什么?谢谢各位了~~~functionjavascript控件
//选择物料
function opendata1(strUrl) {
var aa = window.showModalDialog(strUrl, window, 'dialogWidth:1030px;dialogHeight:500px;center:yes;status:no;dialogWidth:1030px;dialogHeight:500px');
if (aa != null)
{
var cc = new Array();
cc = aa.split('|');
var theform = document.forms[0];
theform.elements["tb_matno"].value = cc[0];
theform.elements["tb_mname"].value = cc[1];
theform.elements["tb_szno"].value = cc[2];
theform.elements["tb_jx"].value = cc[3];
theform.elements["tb_spname"].value = cc[4];
theform.elements["tb_tongym"].value = cc[5];
theform.elements["tb_munit"].value = cc[6];
theform.elements["tb_munit1"].value = cc[7];
theform.elements["tb_produce"].value = cc[8];
theform.elements["tb_cxtj"].value = cc[9];
theform.elements["tb_zl"].value = cc[10];
theform.elements["tb_orgn_code"].value = cc[11];
}
return false;
}
</script>
上面的代码中,我要为各个控件赋值,前面三个可以取得,后面的就怎么也赋不进去,前提是CC[*]都是有值的,请各位帮忙,是为什么?谢谢各位了~~~functionjavascript控件
FF 按F12 打开点控制台,如果管着就开启,然后刷新页面,点错误查看
var aa = window.showModalDialog(strUrl, window, 'dialogWidth:1030px;dialogHeight:500px;center:yes;status:no;dialogWidth:1030px;dialogHeight:500px');
if (aa != null)
{
try {
var cc = new Array();
cc = aa.split('|');
var theform = document.forms[0];
theform.elements["tb_matno"].value = cc[0];
theform.elements["tb_mname"].value = cc[1];
theform.elements["tb_szno"].value = cc[2];
theform.elements["tb_jx"].value = cc[3];
theform.elements["tb_spname"].value = cc[4];
theform.elements["tb_tongym"].value = cc[5];
theform.elements["tb_munit"].value = cc[6];
theform.elements["tb_munit1"].value = cc[7];
theform.elements["tb_produce"].value = cc[8];
theform.elements["tb_cxtj"].value = cc[9];
theform.elements["tb_zl"].value = cc[10];
theform.elements["tb_orgn_code"].value = cc[11];
} catch(e) {
alert(e);
}
}
return false;
}