<form name="frm">
<input type="radio" value="1" name="radioname">
<input type="radio" value="2" name="radioname">
<input type="button" onclick="alert(checkradio(this.form.radioname));">
</form>
<script language="javascript">
<!--
//求单选按纽的值,适用单选项及多选项。未选返回false;有选择项,返回选项值。
function checkradio(theradio){
var theradiolen = theradio.length;
var theradiovalue = false;
if (theradiolen == undefined){
if (theradio.checked){
theradiovalue = theradio.value;
}
}else{
for (theradioi=0;theradioi<theradiolen;theradioi++){
if (theradio[theradioi].checked){
theradiovalue = theradio[theradioi].value;
break;
}
}
}
return theradiovalue;
}
//-->
</script>
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器