日期:2014-05-16 浏览次数:20977 次
<form name='formEdit' action='city_save.asp' target="sub" METHOD='POST'>
<tr class=InputFrameLine>
<td class="InputLabelCell" align="right" width="40"> 省份</td>
<td class="InputLabelCell" width="150">
<select name="cboJG" id="cboJG" style="width:100%">
<%rsZD.Open "Select * from zdJG",conn
do while not rsZD.EOF
%>
<option value="<%=rsZD("DM")%>"><%=rsZD("MC")%></option>
<%
rsZD.MoveNext
loop
rsZD.Close%>
</select>
</td></tr>
<tr class=InputFrameLine>
<td class="InputLabelCell" align="right" width="40"> 城市</td>
<td class="InputLabelCell" width="150">
<input type="text" name="txtNR" id="txtNR" class="input" style="width:100%">
</td>
</tr>
<tr class='InputFrameButtonLine'>
<td align="center" colspan="2">
<input type='button' class='button' value='保存' onclick='javascript:doSave()' >
<input type='reset' class='button' value='放弃' id='reset' name='reset'>
<input type='button' class='button' value='返回' onClick="vbscript:location.href='zdgl.asp?ZDBM=ZDCITY&type=rs'" >
</td>
</tr>
</form>
<%@ Language=VBScript %>
<!-- #include file="..\share\connectdb.asp" -->
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
cboJG= request("cboJG")
city = request("txtNR")
Set rs1=Server.CreateObject("ADODB.Recordset")
sqltable = "select dm from zdjg where mc='"&cboJG&"'"
rs1.open sqltable,conn,1,1
if not rs1.eof then
id = rs1("dm")
end if
rs1.Close()
on error resume next
'打开表连接
Set rs=Server.CreateObject("ADODB.Recordset")
'增加记录
sqltable="select * from zdcity"
rs.open sqltable,conn,3,3
rs.AddNew
rs("mc")= city
rs("id")= id
rs.Update
%>
<script language=javascript>
alert("保存成功!");
parent.location.href='zdgl.asp?ZDBM=ZDCITY&type=rs'
</script>
<%
rs.Close()
set rs = nothing
conn.close
set conn = nothing
%>
</BODY>
</HTML>