<form method='post' name='form1' action="yunfeicount.asp" onSubmit="return checkAddReco(this)">
...
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'><strong>目的国家:</strong></td>
<td class='tdbg'><select name='CountryID' id='CountryID'> <option value="" selected>请选择</option>
<%
Dim Rs,Sql,RsCount
Set Rs= Server.CreateObject("ADODB.Recordset")
Sql="Select CountryID,Country From PE_Country Order By CountryID"
Rs.open Sql,conn,1,1
If Not(Rs.Bof Or Rs.Eof) Then
RsCount=Rs.RecordCount
for i=1 to RsCount
%>
<option value="<%=Rs(0)%>"><%=Rs(1)%></option>
<%
Rs.MoveNext
Next
End If
Rs.Close
%></select></td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'><strong>快递公司:</strong></td>
<td class='tdbg'><select name="ExpressID" onchange="getsubcategory('test.asp?ExpressID='+this.value,'ajax_content');">
<option value="" selected="selected">请选择快递公司</option><%
Dim Rs2,Sql2,RsCount2
Set Rs2= Server.CreateObject("ADODB.Recordset")
Sql2="Select ExpressID,Express From PE_Express Order By ExpressID"
Rs2.open Sql2,conn,1,1
If Not(Rs2.Bof Or Rs2.Eof) Then
RsCount2=Rs2.RecordCount
for i=1 to RsCount2
%>
<option name="ExpressID" value="<%=Rs2(0)%>"><%=Rs2(1)%></option>
<%
Rs2.MoveNext
Next
End If
Rs2.Close
%>
</select></td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right' valign="top"><strong>快递业务:</strong></td>
<td class='tdbg'><div id="ajax_content">选择快递公司后,会自动显示该快递公司所有快递业务分类,请根据实际情况选择业务分类。</div></td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'><strong>货物重量:</strong></td>
<td class='tdbg'><input name="Weight" type="text" id="Weight" size="25" maxlength="10">克 </td>
</tr>
<tr class='tdbg'>
<td colspan='2' align='center' class='tdbg'>
<input type="submit" name="SaveAddButton" id="SaveAddButton" value="查询" style='cursor:hand;'>
</td>
</tr>
</table>
</form>
<script>
function checkAddReco(obj){
if(obj.CountryID.value==""){
alert("请选择目的国家");
obj.CountryID.focus();
return false;
}
if(obj.ExpressID.value==""){
alert("请选择快递公司");
obj.ExpressID.focus();
return false;
}
if(document.getElementById("ExpressID").value=="")
{
alert("请选择快递业务类型");
document.getElementById("ExpressID").focus();
return false;
}
if(obj.Weight.value==""){
alert("请输入货物重量");
obj.Weight.focus();
return false;
} document.form1.submit();
return false;
}
</script>
现在已经能实现选择快递公司后自动出现该公司的所有业务类型,用单选框来列出所有类型供选择,但是默认都是没有选中的,需要提醒要选择一个业务类型,但是现在不起作用,用的是论坛上朋友给的ajax的方法来处理的。
他给的那个test.asp代码如下:
<%Response.Charset="GB2312"%>
<!--#include file="Conn1.asp" -->
<%
Dim Rs3,Sql3,RsCount,ExpressID
ExpressID= Request("ExpressID")
Set Rs3= Server.CreateObject("ADODB.Recordset")
Sql3="Select ExpyewuID,Expyewu From PE_Expyewu Where ExpressID='"&ExpressID&"' Order By ExpyewuID"
Rs3.open Sql3,conn,1,1
If Not(Rs3.Bof Or Rs3.Eof) Then
RsCount=Rs3.RecordCount
for i=1 to RsCount
%>
<input type="radio" name="ExpyewuID" id="ExpyewuID" value="<%=Rs3("ExpyewuID")%>"><%=Rs3("Expyewu")%><br />
<%
Rs3.MoveNext
Next
End If
Rs3.Close
%>,说因为使用了ajax技术,所以这个页面中的form中的那些项目可以等同于就是我这个查询页面中form中的项目,因此判断用是该起作用的,但是现在没有起作用,不知道问题在哪里?
...
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'><strong>目的国家:</strong></td>
<td class='tdbg'><select name='CountryID' id='CountryID'> <option value="" selected>请选择</option>
<%
Dim Rs,Sql,RsCount
Set Rs= Server.CreateObject("ADODB.Recordset")
Sql="Select CountryID,Country From PE_Country Order By CountryID"
Rs.open Sql,conn,1,1
If Not(Rs.Bof Or Rs.Eof) Then
RsCount=Rs.RecordCount
for i=1 to RsCount
%>
<option value="<%=Rs(0)%>"><%=Rs(1)%></option>
<%
Rs.MoveNext
Next
End If
Rs.Close
%></select></td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'><strong>快递公司:</strong></td>
<td class='tdbg'><select name="ExpressID" onchange="getsubcategory('test.asp?ExpressID='+this.value,'ajax_content');">
<option value="" selected="selected">请选择快递公司</option><%
Dim Rs2,Sql2,RsCount2
Set Rs2= Server.CreateObject("ADODB.Recordset")
Sql2="Select ExpressID,Express From PE_Express Order By ExpressID"
Rs2.open Sql2,conn,1,1
If Not(Rs2.Bof Or Rs2.Eof) Then
RsCount2=Rs2.RecordCount
for i=1 to RsCount2
%>
<option name="ExpressID" value="<%=Rs2(0)%>"><%=Rs2(1)%></option>
<%
Rs2.MoveNext
Next
End If
Rs2.Close
%>
</select></td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right' valign="top"><strong>快递业务:</strong></td>
<td class='tdbg'><div id="ajax_content">选择快递公司后,会自动显示该快递公司所有快递业务分类,请根据实际情况选择业务分类。</div></td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'><strong>货物重量:</strong></td>
<td class='tdbg'><input name="Weight" type="text" id="Weight" size="25" maxlength="10">克 </td>
</tr>
<tr class='tdbg'>
<td colspan='2' align='center' class='tdbg'>
<input type="submit" name="SaveAddButton" id="SaveAddButton" value="查询" style='cursor:hand;'>
</td>
</tr>
</table>
</form>
<script>
function checkAddReco(obj){
if(obj.CountryID.value==""){
alert("请选择目的国家");
obj.CountryID.focus();
return false;
}
if(obj.ExpressID.value==""){
alert("请选择快递公司");
obj.ExpressID.focus();
return false;
}
if(document.getElementById("ExpressID").value=="")
{
alert("请选择快递业务类型");
document.getElementById("ExpressID").focus();
return false;
}
if(obj.Weight.value==""){
alert("请输入货物重量");
obj.Weight.focus();
return false;
} document.form1.submit();
return false;
}
</script>
现在已经能实现选择快递公司后自动出现该公司的所有业务类型,用单选框来列出所有类型供选择,但是默认都是没有选中的,需要提醒要选择一个业务类型,但是现在不起作用,用的是论坛上朋友给的ajax的方法来处理的。
他给的那个test.asp代码如下:
<%Response.Charset="GB2312"%>
<!--#include file="Conn1.asp" -->
<%
Dim Rs3,Sql3,RsCount,ExpressID
ExpressID= Request("ExpressID")
Set Rs3= Server.CreateObject("ADODB.Recordset")
Sql3="Select ExpyewuID,Expyewu From PE_Expyewu Where ExpressID='"&ExpressID&"' Order By ExpyewuID"
Rs3.open Sql3,conn,1,1
If Not(Rs3.Bof Or Rs3.Eof) Then
RsCount=Rs3.RecordCount
for i=1 to RsCount
%>
<input type="radio" name="ExpyewuID" id="ExpyewuID" value="<%=Rs3("ExpyewuID")%>"><%=Rs3("Expyewu")%><br />
<%
Rs3.MoveNext
Next
End If
Rs3.Close
%>,说因为使用了ajax技术,所以这个页面中的form中的那些项目可以等同于就是我这个查询页面中form中的项目,因此判断用是该起作用的,但是现在没有起作用,不知道问题在哪里?
解决方案 »
- 求一个加密的问题?
- http://tiaotiaotu.com/index.asp 上面导航栏颜色变化怎么做的 当点击一个按钮的是怎么把另一个消失掉
- 请教一个jquery选择器的问题
- javaScript中insertBefore标签无法显示
- 正则表达式验证日期一例,请帮忙查错
- 请问有人用过EXTJS 做过主从表吗 ?
- button的onClick事件
- 梅花雪.发现你的TREE在使用中有个极为不爽的地方?请修正
- 小问题 希望大家帮忙
- 怎么在一个窗口起来(onload)的时候,控制该窗口的大小,布局等属性????
- 请帮着看看这段JS动画展开收缩脚本,急在线等
- hookee 进来看一下,还是昨天的那个问题JS分类菜单
<option name="ExpressID" value=" <%=Rs2(0)%>"> <%=Rs2(1)%> </option>下面红色代码是否重复判断了ExpressID,而且ID为ExpressID的控件根本找不到,所以JS报错,form跳过验证直接提交了,所以判断没起作用
function checkAddReco(obj){
if(obj.CountryID.value==""){
alert("请选择目的国家");
obj.CountryID.focus();
return false;
}
if(obj.ExpressID.value==""){
alert("请选择快递公司");
obj.ExpressID.focus();
return false;
}
if(document.getElementById("ExpressID").value=="")
{
alert("请选择快递业务类型");
document.getElementById("ExpressID").focus();
return false;
}
if(obj.Weight.value==""){
alert("请输入货物重量");
obj.Weight.focus();
return false;
} document.form1.submit();
return false;
}
...
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'> <strong>目的国家: </strong> </td>
<td class='tdbg'> <select name='CountryID' id='CountryID'> <option value="" selected>请选择 </option>
<%
Dim Rs,Sql,RsCount
Set Rs= Server.CreateObject("ADODB.Recordset")
Sql="Select CountryID,Country From PE_Country Order By CountryID"
Rs.open Sql,conn,1,1
If Not(Rs.Bof Or Rs.Eof) Then
RsCount=Rs.RecordCount
for i=1 to RsCount
%>
<option value=" <%=Rs(0)%>"> <%=Rs(1)%> </option>
<%
Rs.MoveNext
Next
End If
Rs.Close
%> </select> </td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'> <strong>快递公司: </strong> </td>
<td class='tdbg'> <select name="ExpressID" onchange="getsubcategory('test.asp?ExpressID='+this.value,'ajax_content');">//这里很关键,是吧ajax返回的内容做成单选集合放到id为'ajax_content'的div中
<option value="" selected="selected">请选择快递公司 </option> <%
Dim Rs2,Sql2,RsCount2
Set Rs2= Server.CreateObject("ADODB.Recordset")
Sql2="Select ExpressID,Express From PE_Express Order By ExpressID"
Rs2.open Sql2,conn,1,1
If Not(Rs2.Bof Or Rs2.Eof) Then
RsCount2=Rs2.RecordCount
for i=1 to RsCount2
%>
<option name="ExpressID" value=" <%=Rs2(0)%>"> <%=Rs2(1)%> </option> //删掉,跟上面的select重名了
<%
Rs2.MoveNext
Next
End If
Rs2.Close
%>
</select> </td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right' valign="top"> <strong>快递业务: </strong> </td>
<td class='tdbg'> <div id="ajax_content">选择快递公司后,会自动显示该快递公司所有快递业务分类,请根据实际情况选择业务分类。 </div> </td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'> <strong>货物重量: </strong> </td>
<td class='tdbg'> <input name="Weight" type="text" id="Weight" size="25" maxlength="10">克 </td>
</tr>
<tr class='tdbg'>
<td colspan='2' align='center' class='tdbg'>
<input type="submit" name="SaveAddButton" id="SaveAddButton" value="查询" style='cursor:hand;'>
</td>
</tr>
</table>
</form>
<script>
function checkAddReco(obj){
if(obj.CountryID.value==""){
alert("请选择目的国家");
obj.CountryID.focus();
return false;
}
if(obj.ExpressID.value==""){
alert("请选择快递公司");
obj.ExpressID.focus();
return false;
}
if(document.getElementById("ExpressID").value=="") //不应该用id,因为应该不是一个单选按钮(再说就是用id你也写错了,是这个ExpyewuID);用document.getElementsByName("ExpyewuID")得到单选按钮集合,遍历看有没有被选中的;
{
alert("请选择快递业务类型");
document.getElementById("ExpressID").focus();
return false;
}
if(obj.Weight.value==""){
alert("请输入货物重量");
obj.Weight.focus();
return false;
} document.form1.submit();
return false;
}
</script>
现在已经能实现选择快递公司后自动出现该公司的所有业务类型,用单选框来列出所有类型供选择,但是默认都是没有选中的,需要提醒要选择一个业务类型,但是现在不起作用,用的是论坛上朋友给的ajax的方法来处理的。
他给的那个test.asp代码如下:
<%Response.Charset="GB2312"%>
<!--#include file="Conn1.asp" -->
<%
Dim Rs3,Sql3,RsCount,ExpressID
ExpressID= Request("ExpressID")
Set Rs3= Server.CreateObject("ADODB.Recordset")
Sql3="Select ExpyewuID,Expyewu From PE_Expyewu Where ExpressID='"&ExpressID&"' Order By ExpyewuID"
Rs3.open Sql3,conn,1,1
If Not(Rs3.Bof Or Rs3.Eof) Then
RsCount=Rs3.RecordCount
for i=1 to RsCount
%>
<input type="radio" name="ExpyewuID" id="ExpyewuID" value=" <%=Rs3("ExpyewuID")%>"> <%=Rs3("Expyewu")%> <br /> //这里就是创建单选按钮(集合),注意name和id,你上面的js中写错了
<%
Rs3.MoveNext
Next
End If
Rs3.Close
%>,说因为使用了ajax技术,所以这个页面中的form中的那些项目可以等同于就是我这个查询页面中form中的项目,因此判断用是该起作用的,但是现在没有起作用,不知道问题在哪里?
<form method='post' name='form1' action="yunfeicount.asp" onSubmit="return checkAddReco(this)">
...
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'> <strong>目的国家: </strong> </td>
<td class='tdbg'> <select name='CountryID' id='CountryID'> <option value="" selected>请选择 </option>
<%
Dim Rs,Sql,RsCount
Set Rs= Server.CreateObject("ADODB.Recordset")
Sql="Select CountryID,Country From PE_Country Order By CountryID"
Rs.open Sql,conn,1,1
If Not(Rs.Bof Or Rs.Eof) Then
RsCount=Rs.RecordCount
for i=1 to RsCount
%>
<option value=" <%=Rs(0)%>"> <%=Rs(1)%> </option>
<%
Rs.MoveNext
Next
End If
Rs.Close
%> </select> </td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'> <strong>快递公司: </strong> </td>
<td class='tdbg'> <select name="ExpressID" onchange="getsubcategory('test.asp?ExpressID='+this.value,'ajax_content');">//这里很关键,是吧ajax返回的内容做成单选集合放到id为'ajax_content'的div中
<option value="" selected="selected">请选择快递公司 </option> <%
Dim Rs2,Sql2,RsCount2
Set Rs2= Server.CreateObject("ADODB.Recordset")
Sql2="Select ExpressID,Express From PE_Express Order By ExpressID"
Rs2.open Sql2,conn,1,1
If Not(Rs2.Bof Or Rs2.Eof) Then
RsCount2=Rs2.RecordCount
for i=1 to RsCount2
%>
<option name="ExpressID" value=" <%=Rs2(0)%>"> <%=Rs2(1)%> </option> //删掉,跟上面的select重名了
<%
Rs2.MoveNext
Next
End If
Rs2.Close
%>
</select> </td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right' valign="top"> <strong>快递业务: </strong> </td>
<td class='tdbg'> <div id="ajax_content">选择快递公司后,会自动显示该快递公司所有快递业务分类,请根据实际情况选择业务分类。 </div> </td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'> <strong>货物重量: </strong> </td>
<td class='tdbg'> <input name="Weight" type="text" id="Weight" size="25" maxlength="10">克 </td>
</tr>
<tr class='tdbg'>
<td colspan='2' align='center' class='tdbg'>
<input type="submit" name="SaveAddButton" id="SaveAddButton" value="查询" style='cursor:hand;'>
</td>
</tr>
</table>
</form>
<script>
function checkAddReco(obj){
if(obj.CountryID.value==""){
alert("请选择目的国家");
obj.CountryID.focus();
return false;
}
if(obj.ExpressID.value==""){
alert("请选择快递公司");
obj.ExpressID.focus();
return false;
}
if(document.getElementById("ExpressID").value=="") //不应该用id,因为应该不是一个单选按钮(再说就是用id你也写错了,是这个ExpyewuID);用document.getElementsByName("ExpyewuID")得到单选按钮集合,遍历看有没有被选中的;
{
alert("请选择快递业务类型");
document.getElementById("ExpressID").focus();
return false;
}
if(obj.Weight.value==""){
alert("请输入货物重量");
obj.Weight.focus();
return false;
} document.form1.submit();
return false;
}
</script>
现在已经能实现选择快递公司后自动出现该公司的所有业务类型,用单选框来列出所有类型供选择,但是默认都是没有选中的,需要提醒要选择一个业务类型,但是现在不起作用,用的是论坛上朋友给的ajax的方法来处理的。
他给的那个test.asp代码如下:
<%Response.Charset="GB2312"%>
<!--#include file="Conn1.asp" -->
<%
Dim Rs3,Sql3,RsCount,ExpressID
ExpressID= Request("ExpressID")
Set Rs3= Server.CreateObject("ADODB.Recordset")
Sql3="Select ExpyewuID,Expyewu From PE_Expyewu Where ExpressID='"&ExpressID&"' Order By ExpyewuID"
Rs3.open Sql3,conn,1,1
If Not(Rs3.Bof Or Rs3.Eof) Then
RsCount=Rs3.RecordCount
for i=1 to RsCount
%>
<input type="radio" name="ExpyewuID" id="ExpyewuID" value=" <%=Rs3("ExpyewuID")%>"> <%=Rs3("Expyewu")%> <br /> //这里就是创建单选按钮(集合),注意name和id,你上面的js中写错了 <%
Rs3.MoveNext
Next
End If
Rs3.Close
%>,说因为使用了ajax技术,所以这个页面中的form中的那些项目可以等同于就是我这个查询页面中form中的项目,因此判断用是该起作用的,但是现在没有起作用,不知道问题在哪里?
test.asp
<%Response.Charset="GB2312"%>
<!--#include file="Conn1.asp" -->
<%
Dim Rs3,Sql3,RsCount,ExpressID
ExpressID= Request("ExpressID")
Set Rs3= Server.CreateObject("ADODB.Recordset")
Sql3="Select ExpyewuID,Expyewu From PE_Expyewu Where ExpressID='"&ExpressID&"' Order By ExpyewuID"
Rs3.open Sql3,conn,1,1
If Not(Rs3.Bof Or Rs3.Eof) Then
RsCount=Rs3.RecordCount
for i=1 to RsCount
%>
<input type="radio" name="ExpyewuID" id="ExpyewuID" value="<%=Rs3("ExpyewuID")%>"><%=Rs3("Expyewu")%><br />
<%
Rs3.MoveNext
Next
End If
Rs3.Close
%>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'><strong>快递公司:</strong></td>
<td class='tdbg'><select name="ExpressID" onchange="getsubcategory('test.asp?ExpressID='+this.value,'ajax_content');">
<option value="" selected="selected">请选择快递公司</option><%
Dim Rs2,Sql2,RsCount2
Set Rs2= Server.CreateObject("ADODB.Recordset")
Sql2="Select ExpressID,Express From PE_Express Order By ExpressID"
Rs2.open Sql2,conn,1,1
If Not(Rs2.Bof Or Rs2.Eof) Then
RsCount2=Rs2.RecordCount
for i=1 to RsCount2
%>
<option value="<%=Rs2(0)%>"><%=Rs2(1)%></option>''这里为什么要让我删除?如果删除了,就不会出现快递公司下拉项可选,然后传递参数到test.asp中去。
<%
Rs2.MoveNext
Next
End If
Rs2.Close
%>
</select></td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right' valign="top"><strong>快递业务:</strong></td>
<td class='tdbg'><div id="ajax_content">选择快递公司后,会自动显示该快递公司所有快递业务分类,请根据实际情况选择业务分类。</div></td>
</tr>
<tr class='tdbg'>
<td width='280' class='tdbg5' align='right'><strong>货物重量:</strong></td>
<td class='tdbg'><input name="Weight" type="text" id="Weight" size="25" maxlength="10">克 </td>
</tr>
<tr class='tdbg'>
<td colspan='2' align='center' class='tdbg'>
<input type="submit" name="SaveAddButton" id="SaveAddButton" value="查询" style='cursor:hand;'>
</td>
</tr>
</table>
</form>
<script>
function checkAddReco(obj){
if(obj.CountryID.value==""){
alert("请选择目的国家");
obj.CountryID.focus();
return false;
}
if(obj.ExpressID.value==""){
alert("请选择快递公司");
obj.ExpressID.focus();
return false;
}
if(document.getElementById("ExpyewuID").value=="")
{
alert("请选择快递业务类型");
document.getElementById("ExpyewuID").focus();
return false;
}''这里我已经改了,让判断的是ExpyewuID,而不是ExpressID
if(obj.Weight.value==""){
alert("请输入货物重量");
obj.Weight.focus();
return false;
} document.form1.submit();
return false;
}
</script>
var selected = false;
for (var i=0;i<aryRadios.length;i++){
if (aryRadios[i].type=="radio" && aryRadios[i].checked) {
selected=true;
break;
}
}
if (!selected) {
alert("请选择快递业务类型");
//document.getElementById("ExpyewuID").focus();
return false;
}
只能取到一个。