主题:谢谢!大侠帮帮忙看看那里有错
<%@ LANGUAGE="VBScript" %>
<html>
<head>
<script language="VBScript">
<!--
Sub query_OnClick
Dim msg
msg = ""
If dlcx.mc.value = "" Then
msg = "单位名称不能为空"
dlcx.mc.focus
ElseIf dlcx.sx.value = "" Then
msg = "表点属性不能为空"
dlcx.sx.focus
End If
ElseIf dlcx.rq.value = "" Then
msg = "日期不能为空"
dlcx.rq.focus
End If
If msg = "" Then
dlcx.submit
Else
Alert(msg)
End If
End Sub
Sub reset_OnClick
dlcx.mc.value = ""
dlcx.sx.value = ""
dlcx.stid.focus
End Sub
-->
</script>
</head>
<body bgcolor="#99CCCC" onLoad="reset_OnClick">
<center>
<font size="6" color="red" face="楷体_GB2312"><b>电量查询网页</b></font>
<marquee bgcolor="aaaaee" behavior="alternate" scrollamount="2">
<font color="yellow" face="楷体_GB2312">欢迎使用电量查询网页!</font>
</marquee>
<form action="dlcxxs.asp" method="post" name="dlcx" target="result" id="dlcx">
<table id="dlcx">
<tr><td colspan="8"><font color="blue">查询条件</font></td></tr>
<tr><td colspan="8"><hr></td></tr>
<tr>
<td>单位名称</td>
<td><select name="dwmc">
<%
' 注释:创建并打开Recordset对象
Set objRS = Session("objRS")
objRS.Source = "SELECT id, title FROM dwmc"
objRS.Open
' 注释:读取记录集中所有的课程记录
Do While Not objRS.EOF
%>
<option value=<% = objRS("id") %><% = objRS("title") %>><% = objRS("title") %></option>
<%
objRS.MoveNext
Loop
' 注释:关闭记录集
objRS.Close
Set objRS = Nothing
%>
</select> </td>
<td>表点属性</td>
<td><select name="bdsx">
<%
' 注释:创建并打开Recordset对象
Set objRS = Session("objRS")
objRS.Source = "SELECT id, title FROM bdsx"
objRS.Open
' 注释:读取记录集中所有的课程记录
Do While Not objRS.EOF
%>
<option value=<% = objRS("id") %><% = objRS("title") %>><% = objRS("title") %></option>
<%
objRS.MoveNext
Loop
' 注释:关闭记录集
objRS.Close
Set objRS = Nothing
%>
</select> </td>
<td>日期</td>
<td><input type="text" name="rq" id="rq">
</td>
<td><input name="query" type="button" value="查询"> </td>
<td><input name="reset" type="button" value="重设"></td>
<tr><td colspan="8"><hr></td></tr>
<tr><td colspan="8"><font color="blue">查询结果</font></td></tr>
</table>
</form>
</center>
</body>
</html>
<html>
<head>
<script language="VBScript">
<!--
Sub query_OnClick
Dim msg
msg = ""
If dlcx.mc.value = "" Then
msg = "单位名称不能为空"
dlcx.mc.focus
ElseIf dlcx.sx.value = "" Then
msg = "表点属性不能为空"
dlcx.sx.focus
End If
ElseIf dlcx.rq.value = "" Then
msg = "日期不能为空"
dlcx.rq.focus
End If
If msg = "" Then
dlcx.submit
Else
Alert(msg)
End If
End Sub
Sub reset_OnClick
dlcx.mc.value = ""
dlcx.sx.value = ""
dlcx.stid.focus
End Sub
-->
</script>
</head>
<body bgcolor="#99CCCC" onLoad="reset_OnClick">
<center>
<font size="6" color="red" face="楷体_GB2312"><b>电量查询网页</b></font>
<marquee bgcolor="aaaaee" behavior="alternate" scrollamount="2">
<font color="yellow" face="楷体_GB2312">欢迎使用电量查询网页!</font>
</marquee>
<form action="dlcxxs.asp" method="post" name="dlcx" target="result" id="dlcx">
<table id="dlcx">
<tr><td colspan="8"><font color="blue">查询条件</font></td></tr>
<tr><td colspan="8"><hr></td></tr>
<tr>
<td>单位名称</td>
<td><select name="dwmc">
<%
' 注释:创建并打开Recordset对象
Set objRS = Session("objRS")
objRS.Source = "SELECT id, title FROM dwmc"
objRS.Open
' 注释:读取记录集中所有的课程记录
Do While Not objRS.EOF
%>
<option value=<% = objRS("id") %><% = objRS("title") %>><% = objRS("title") %></option>
<%
objRS.MoveNext
Loop
' 注释:关闭记录集
objRS.Close
Set objRS = Nothing
%>
</select> </td>
<td>表点属性</td>
<td><select name="bdsx">
<%
' 注释:创建并打开Recordset对象
Set objRS = Session("objRS")
objRS.Source = "SELECT id, title FROM bdsx"
objRS.Open
' 注释:读取记录集中所有的课程记录
Do While Not objRS.EOF
%>
<option value=<% = objRS("id") %><% = objRS("title") %>><% = objRS("title") %></option>
<%
objRS.MoveNext
Loop
' 注释:关闭记录集
objRS.Close
Set objRS = Nothing
%>
</select> </td>
<td>日期</td>
<td><input type="text" name="rq" id="rq">
</td>
<td><input name="query" type="button" value="查询"> </td>
<td><input name="reset" type="button" value="重设"></td>
<tr><td colspan="8"><hr></td></tr>
<tr><td colspan="8"><font color="blue">查询结果</font></td></tr>
</table>
</form>
</center>
</body>
</html>