楼上,请问: 我在ASP中怎么调试不通?并且<% dim all:all=request.form("all") if all<>"" then response.write all %>为什么会这样写?ASP中不是这样写啊
不同过?什么意思?出错?dim all'定义一个变量 all=request.form("all")'获取客户端表单中的name='all'的控件的值,因为表单为post提交,所以需要request.form,reuest也可以 if all<>"" then response.write all '如果all变量的值不为空则输出这个变量的值
dim all:all=request.form("all")'这句?? '你是没见过这样写而已,":" 是重起一行的意思,这样可以把多行代码写到一行来
不会输出ALL的值, 并且ASP的写法也不是这样啊dim all'定义一个变量 all=request.form("all")'获取客户端表单中的name='all'的控件的值,因为表单为post提交,所以需要request.form,reuest也可以 if all<>"" then response.write all '如果all变量的值不为空则输出这个变量的值 ----------------------- dim all all=request.form("all") if all<>"" then response.write all end if
<script language="javascript">
function cc()
{
var oC=document.form1.sItem;
var t=0;
if(oC)
{
for(var i=0;i <oC.length;i++)
{
if(oC(i).checked) t++
}
}
if(t==oC.length)
{
document.write("全选");
}
else if(t==0)
{document.write("无")}
else{
document.write("选择部分")
}
}
</script>
</head>
<body>
<form name="form1" ID="Form1">
<p> 请选择项目: <br>
<input type="checkbox" value="CRC" name="sItem">
<br>
<input type="checkbox" value="Northsnow" name="sItem" ID="Checkbox1">
<br>
<input type="checkbox" value="CSDN" name="sItem" ID="Checkbox2">
<br>
<input type="checkbox" value="a" name="sItem" ID="Checkbox3">
<br>
<input type="checkbox" value="b" name="sItem" ID="Checkbox4">
<br>
<input type="checkbox" value="c" name="sItem" ID="Checkbox5">
<br>
<input type="checkbox" value="d" name="sItem" ID="Checkbox6">
<br>
<input type="checkbox" value="e" name="sItem" ID="Checkbox7">
<br>
<input type="checkbox" value="f" name="sItem" ID="Checkbox8">
<br>
<input type="checkbox" value="g" name="sItem" ID="Checkbox9">
<br>
<input type="button" name="ss" value="OK" onclick="cc();">
</p>
</form>
<%Response.write aa%>
</body>
</html>
<script language="javascript">
function cc()
{
var oC=document.form1.sItem;
var t=0;
if(oC)
{
for(var i=0;i <oC.length;i++)
{
if(oC(i).checked) t++
}
}
var all=document.getElementById("all");
if(t==oC.length)
{
all.value="全选";
}
else if(t==0)
{
all.value="无";
}
else{
all.value="选择部分";
}
}
</script>
</head>
<body>
<form name="form1" ID="Form1" method="post">
<p> 请选择项目: <br>
<input type="checkbox" value="CRC" name="sItem">
<br>
<input type="checkbox" value="Northsnow" name="sItem" ID="Checkbox1">
<br>
<input type="checkbox" value="CSDN" name="sItem" ID="Checkbox2">
<br>
<input type="checkbox" value="a" name="sItem" ID="Checkbox3">
<br>
<input type="checkbox" value="b" name="sItem" ID="Checkbox4">
<br>
<input type="checkbox" value="c" name="sItem" ID="Checkbox5">
<br>
<input type="checkbox" value="d" name="sItem" ID="Checkbox6">
<br>
<input type="checkbox" value="e" name="sItem" ID="Checkbox7">
<br>
<input type="checkbox" value="f" name="sItem" ID="Checkbox8">
<br>
<input type="checkbox" value="g" name="sItem" ID="Checkbox9">
<br>
<input type="button" name="ss" value="OK" onclick="cc();">
<input type="hidden" name="all" id="all" /><!--加个隐藏的-->
</p>
</form>
<%
dim all:all=request.form("all")
if all<>"" then response.write all
%>
</body>
</html>
我在ASP中怎么调试不通?并且<%
dim all:all=request.form("all")
if all<>"" then response.write all
%>为什么会这样写?ASP中不是这样写啊
all=request.form("all")'获取客户端表单中的name='all'的控件的值,因为表单为post提交,所以需要request.form,reuest也可以
if all<>"" then response.write all '如果all变量的值不为空则输出这个变量的值
'你是没见过这样写而已,":" 是重起一行的意思,这样可以把多行代码写到一行来
并且ASP的写法也不是这样啊dim all'定义一个变量
all=request.form("all")'获取客户端表单中的name='all'的控件的值,因为表单为post提交,所以需要request.form,reuest也可以
if all<>"" then response.write all '如果all变量的值不为空则输出这个变量的值
-----------------------
dim all
all=request.form("all")
if all<>"" then response.write all end if