用汉字行,但是调用数据库数据就不行了。
<%sub addhw()%>
<br>
<table width="95%" cellspacing="1" cellpadding="3" bgcolor="#999999" align="center">
<form action="qiche.asp?action=savehw" method=POST name=addhw>
<tr bgcolor="#CCCCCC">
<td colspan="6" align="center"><font color=blue><strong>发 货</strong></font></td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="6" height="5"></td>
</tr>
<tr bgcolor=#eeeeee>
<td colspan="6" align=right><div align="left"> 运输方式:
<input name="yshfsh" type="text" id="yshfsh" value="汽车" readonly>
</div></td>
</tr>
<tr bgcolor=#eeeeee>
<td width="13%" align=right>托运日期:</td>
<td colspan="2"><select name=fhyear id="fhyear">
<option value=""></option>
<%for i=2000 to 2015%>
<option value="<%=i%>"
<%if cint(year(date()))=cint(i) then response.write "selected"%>> <%=i%></option>
<%next%>
</select>
年
<select name=fhmonth id="fhmonth">
<option value=""></option>
<%for i=1 to 12%>
<option value="<%=i%>"
<%if cint(month(date()))=cint(i) then response.write "selected"%>> <%=i%></option>
<%next%>
</select>
月
<select name=fhday id="fhday">
<option value=""></option>
<%for i=1 to 31%>
<option value="<%=i%>"
<%if cint(day(date()))=cint(i) then response.write "selected"%>> <%=i%></option>
<%next%>
</select>
日</td>
<td width="15%"><div align="right">计划到达日期:</div></td>
<td colspan="2"><select name=jhyear id="jhyear">
<option value=""></option>
<%for i=2000 to 2015%>
<option value="<%=i%>"
<%if cint(year(date()))=cint(i) then response.write "selected"%>> <%=i%></option>
<%next%>
</select>
年
<select name=jhmonth id="jhmonth">
<option value=""></option>
<%for i=1 to 12%>
<option value="<%=i%>"
<%if cint(month(date()))=cint(i) then response.write "selected"%>> <%=i%></option>
<%next%>
</select>
月
<select name=jhday id="jhday">
<option value=""></option>
<%for i=1 to 31%>
<option value="<%=i%>"
<%if cint(day(date()))=cint(i) then response.write "selected"%>> <%=i%></option>
<%next%>
</select>
日</td>
</tr>
<tr bgcolor=#eeeeee>
<td rowspan="3" align=right>发货单位:</td>
<td width="9%">名 称:</td>
<td width="27%"><select name="fhname" size="1" onChange=bb(this.options[this.selectedIndex].value)>
<option >请选择</option>
<%set rs = server.CreateObject ("Adodb.recordset")
sql = "select * from [fhdw] order by fhdwid desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<option value=>请先添加来源</option>"
else
do while not rs.EOF%>
<option value=<%=rs("fhname")%>><%=rs("fhname")%></option>
<%rs.MoveNext
loop
end if
rs.Close
set rs=nothing%>
</select>
</td>
<td rowspan="3"><div align="right">收货单位:</div></td>
<td width="7%">名称:</td>
<td width="29%"><input name="shhname" type="text" id="shhname"></td>
</tr>
<tr bgcolor=#eeeeee>
<td>地 址:</td>
<td><input name="fhaddr" type="text" id="fhaddr"></td>
<td>地址:</td>
<td><input name="shhaddr" type="text" id="shhaddr"></td>
</tr>
<tr bgcolor=#eeeeee>
<td>电 话:</td>
<td><input name="fhtel" type="text" id="fhtel"></td>
<td>电话:</td>
<td><input name="shhtel" type="text" id="shhtel"></td>
</tr>
<tr bgcolor=#eeeeee>
<td rowspan="3" align=right>承运单位:</td>
<td>名 称:</td>
<td><input name="chyname" type="text" id="chyname"></td>
<td rowspan="3">&nbsp;</td>
<td colspan="2" rowspan="3">&nbsp;</td>
</tr>
<tr bgcolor=#eeeeee>
<td>联系人:</td>
<td><input name="chyperson" type="text" id="chyperson"></td>
</tr>
<tr bgcolor=#eeeeee>
<td>电 话:</td>
<td><input name="chytel" type="text" id="chytel"></td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="6" height="5"></td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>车号:</td>
<td colspan="2"><input name="qchno" type="text" id="qchno"></td>
<td><div align="right">车型:</div></td>
<td colspan="2"><input name="chx" type="text" id="chx"></td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>发货地点:</td>
<td colspan="2"><input name="fhaddr" type="text" id="fhaddr"></td>
<td><div align="right">到货地点:</div></td>
<td colspan="2"><input name="dhaddr" type="text" id="dhaddr"></td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>司机姓名:</td>
<td colspan="2"><input name="driver" type="text" id="driver"></td>
<td><div align="right">身份证号:</div></td>
<td colspan="2"><input name="shfnum" type="text" id="shfnum"></td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>联系电话:</td>
<td colspan="2"><input name="tel" type="text" id="tel"></td>
<td>&nbsp;</td>
<td colspan="2">&nbsp;</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="6" height="5"></td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>货物名称:</td>
<td colspan="2"><input name="hwname" type="text" id="hwname"> </td>
<td><div align="right">件数:</div></td>
<td colspan="2"><input name="jsh" type="text" id="jsh"></td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>重量(吨):</td>
<td colspan="2"><input name="weight" type="text" id="weight"></td>
<td><div align="right">批号:</div></td>
<td colspan="2"><input name="ph" type="text" id="ph"></td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>包型:</td>
<td colspan="2"><input name="bx" type="text" id="bx"></td>
<td><div align="right">质量标识:</div></td>
<td colspan="2"><input name="zhlbzh" type="text" id="zhlbzh"></td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>产地:</td>
<td colspan="2"><input name="chd" type="text" id="chd"></td>
<td><div align="right">加工单位:</div></td>
<td colspan="2"><input name="jgdw" type="text" id="jgdw"></td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>&nbsp;</td>
<td colspan="2">&nbsp;</td>
<td>&nbsp;</td>
<td colspan="2">&nbsp;</td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>&nbsp;</td>
<td colspan="2">&nbsp;</td>
<td>&nbsp;</td>
<td colspan="2">&nbsp;</td>
</tr>
<tr bgcolor=#eeeeee>
<td align=right>备 注:</td>
<td colspan="5"><textarea name="other" cols="40" rows="5" id="other"></textarea></td>
</tr>
<tr bgcolor=#eeeeee>
<td colspan="6"><div align="center">
<input type="submit" name="Submit" value="确定">
&nbsp;&nbsp;
<input type="Reset" name="Reset" value="重填">
</div></td>
</tr>
</form>
</table>
<br>
<%end sub%>
<script language="JavaScript">
function bb(num){
dw = new Array();
//读数据库生成数组
<%sql = "select fhdwid,fhname,fhaddr,fhtel from [fhdw] order by fhdwid desc"
rs.open sql,conn,1,1
do while not rs.eof%>
dw[<%=rs("fhdwid")%>]= new Array("<%=rs("fhaddr")%>","<%=rs("fhtel")%>","1");
<%rs.movenext
loop
rs.close%>
addhw.fhaddr.value=dw[num][0];
addhw.fhtel.value=dw[num][1];
}
</script>