iLeichun

当前位置: 首页 > Asp

ASP中怎样获取单选框的值

分类:Asp   来源:网络   时间:2010-11-20 14:36:25

<html>
<head><title>sex</title></head>
<%
strsex=”"
if request(”radsex”)=”M” then
strsex=”帅哥”
elseif request(”radsex”)=”F” then
strsex=”美女”
end if
if request(”radedu”)=”1″ then edu=”初中”
if request(”radedu”)=”2″ then edu=”高中”
if request(”radedu”)=”3″ then edu=”大学”
if request(”radedu”)=”4″ then edu=”硕士”
response.write “这位” &strsex &”的学历是” &edu
%>
<form method=post action=”sex.asp”>
<fieldset>
<legend>性别</legend>
<input type=radio name=radsex value=”M” checked>男</br>
<input type=radio name=radsex value=”F”>女</br>
</fieldset>
<fieldset>
<legend>学历</legend>
<input type=radio name=radedu value=1 checked>初中</br>
<input type=radio name=radedu value=2>高中</br>
<input type=radio name=radedu value=3>大学</br>
<input type=radio name=radedu value=4>硕士</br>
</fieldset>
<p></p>
<input type=submit name=btnok value=确定>
</form>
</body>
</html>

更多