asp单选按钮的一个问题
<formname="form1"method="post"action=""onsubmit="varch=0;for(i=0;i<document.all.radio...
<form name="form1" method="post" action="" onsubmit="var ch=0;for(i=0;i<document.all.radiobutton.length;i++)if(document.all.radiobutton[i].checked==true)ch=1;if(ch==0)alert();return false">
<label>
<input type="radio" name="1" value="50">
50</label>
<label>
<input type="radio" name="2" value="100">
100</label>
<label>
<input type="radio" name="3" value="200">
200</label>
<input type="submit" name="Submit" value="提交">
</form>
按下了 提交 按钮把
选择的单选按钮的数加起来
计算总数 展开
<label>
<input type="radio" name="1" value="50">
50</label>
<label>
<input type="radio" name="2" value="100">
100</label>
<label>
<input type="radio" name="3" value="200">
200</label>
<input type="submit" name="Submit" value="提交">
</form>
按下了 提交 按钮把
选择的单选按钮的数加起来
计算总数 展开
展开全部
<form name="form1" method="post" action="" onsubmit="var ch=0;for(i=0;i<document.all.radiobutton.length;i++)if(document.all.radiobutton[i].checked==true)ch=1;if(ch==0)alert();return false">
<label>
<input type="radio" name="r1" value="50">
50</label>
<label>
<input type="radio" name="r2" value="100">
100</label>
<label>
<input type="radio" name="r3" value="200">
200</label>
<input type="submit" name="Submit" value="提交">
</form>
<%
if isnumeric(request("r1")) and isnumeric(request("r2")) and isnumeric(request("r3")) then
r1=cint(request("r1"))
r2=cint(request("r2"))
r3=cint(request("r3"))
Response.write("r1+r2+r3="&r1+r2+r3)
end if
%>
<label>
<input type="radio" name="r1" value="50">
50</label>
<label>
<input type="radio" name="r2" value="100">
100</label>
<label>
<input type="radio" name="r3" value="200">
200</label>
<input type="submit" name="Submit" value="提交">
</form>
<%
if isnumeric(request("r1")) and isnumeric(request("r2")) and isnumeric(request("r3")) then
r1=cint(request("r1"))
r2=cint(request("r2"))
r3=cint(request("r3"))
Response.write("r1+r2+r3="&r1+r2+r3)
end if
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询