回复 第2楼 Kettyjin1983 的帖子
出错了,请各位帮忙看看,都好几天了,没解决啊
<script language="javascript">
var j;
j=0;
igarage = new Array();
<%set rs=conn.execute("select * from Inven2 where org = '"&org&"'")
if rs.eof then%>
igarage[0] = new Array("No","");
<%else
i=0
do while not rs.eof%>
igarage[<%=i%>] = new Array("<%=rs("org")%>","<%=rs("garage")%>");
<% rs.movenext
i=i+1
loop
end if
rs.close
%>
function set_garage(org,garage)
{
document.form1.garage.length = 0;
var pv, cv;
var i, ii;
pv=org.value;
cv=garage.value;
garage.length=1;
if(pv=='0') return;
if(typeof(igarage[pv])=='undefined') return;
for(i=0; i<igarage[pv].length; i++)
{
ii = i+1;
garage.options[ii] = new Option();
garage.options[ii].text = igarage[pv][i];
garage.options[ii].value = igarage[pv][i];
}
}
<tr>
<td width="216" class="td6" height="35">组织:</td>
<td> <select size = "1" name = "org" onChange="set_garage(this,document.form1.getElementById('garage'));">
<option value=""></option>
<option value="JV1">JV1</option>
<option value="JV2">JV2</option>
</select>
</td>
</tr>
<tr>
<td width="216" class="td6" height="35">库位:</td>
<td>
<select size = "1" name = "garage">
<option value=0></option>
</select>
</td>
</tr>