function khxz_onclick(){
frm=document.frmplanfill;
ghstj=frm.kh_id.value; //获得当前页面上刚刚选中的
“供货商”的 kh_id
值。
numkh=khstr.indexof(ghstj,0) ; //从 khstr 串中找到该 kh_id
值所在的位置。
addr=khstr.substring(khstr.indexof("|",numkh)+1,khstr.indexof("|",khstr.indexof("|",numkh)+1)); //
从 khstr 串中取出与 kh_id
对应的地址字段的值。
frm.address.value=addr; //将取出的值赋给当前录入页面上的字段变量 address
。
}
</script>
3.在 html
中将二者结合起来,互为所用
$khinfo="select kh_id,address from kh where co_id=$s_coid and type='g' order by kh_id";
//将取供货商信息的 sql 语句放到变量$khinfo
中。
$k=khqk_tq($khinfo); //调用 php 函数,并将返回的字符串值放到变量$k
中。
<meta name="generator" content="microsoft developer studio">
<meta http-equiv="content-type" content="text/html; charset=gb_2312-80">
<title>订货合同管理</title>
</head>
<body style="background-color: ivory">
<form name=frmplanfill method=post action="dhht_crt.php">
<table align=center border=1 cellpadding=0 cellspacing=0 width="90%" style="font-size: 10pt">