asp中如何读取单选按钮的值并使用这个值

来源:百度知道 编辑:UC知道 时间:2024/05/27 23:38:31
设计一个代码片段如下:
<input name="sex" id="sex" type="radio" value="男" checked> 男
<input name="sex" id="sex" type="radio"value="女">女

<SCRIPT language="JavaScript">
return confirm("你选择的性别是**,确定吗?")
</script>
把confirm里面的代码给出来吧

<input name="sex" id="sex" type="radio" value="男" checked> 男
<input name="sex" id="sex" type="radio"value="女">女
<input type = button value="read"onclick="read()">
</body>
<script language="javascript">
function read()
{
var str;
for(var i=0;i<document.all.sex.length;i++)
{
if(document.all.sex[i].checked ==true)
str = document.all.sex[i].value;
}
confirm("你选择的性别是"+str+",确定吗?");
}
</script>

sex.value,不过这个是jsp的吧?