动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
  
   PHP → 阅读文章

 求单选按纽的值,适用单选项及多选项

作者来源: 
阅读 1475 人次 , 2006-3-29 4:08:00 


<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>

 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:一个很实用和好用的资源管理器的树形目录源码
· 下一篇:一个用session传递对象的典型例子
· PHP找回密码机制流程
· 应用NuSoap构建新型的基于PHP的Web服务
· PHP4实际应用经验篇(6)
· 目前国内的主流程序主要存在以下问题
· PHP文本数据库的搜索方法


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077