CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
花落谁家,你作主! 盛大widget设计大赛英雄榜
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  .NET技术 >  ASP.NET

为什么得不到RadioButtonList1的值?

楼主clkun(我来是学习)2005-06-02 01:22:30 在 .NET技术 / ASP.NET 提问

<form   name="Form1"   method="post"   action="GetPropertyNo.aspx"   id="Form1">  
  <table   ><tr><td><table   id="RadioButtonList1"   border="0">  
  <tr>  
  <td><input   id="RadioButtonList1_0"   type="radio"   name="RadioButtonList1"   value="001"   /><label   for="RadioButtonList1_0">集体</label></td>  
  </tr><tr>  
  <td><input   id="RadioButtonList1_1"   type="radio"   name="RadioButtonList1"   value="002"   /><label   for="RadioButtonList1_1">股份制</label></td>  
  </tr>  
  </table></td></tr></table>  
  <INPUT   TYPE="button"   class="MyButton"   value="确定"   onclick="fnGetInfo();"   <INPUT   TYPE="button"     value="取消"   onclick="fnCancel();">  
   
  </form>  
   
   
   
   
   
  <SCRIPT>  
  function   CheckBox(CheckBoxSet)  
  {  
  var   str;  
  str='';  
  for(i=0;CheckBoxSet.length-1;i++)  
  {  
  if(CheckBoxSet(i).checked)  
  {  
    str=CheckBoxSet(i).value  
  }  
  //str=CheckBoxSet.value;  
  }  
  return   str;  
  }  
  </SCRIPT>  
   
  上述调用     CheckBox(document.Form1.RadioButtonList1)   为何得不到   所选的值? 问题点数:0、回复次数:2Top

1 楼clkun(我来是学习)回复于 2005-06-02 01:38:28 得分 0

用这个方法得到了  
   
  function   CheckBox()  
  {  
  var   str;  
  str='';  
  var   obj=document.getElementsByName("RadioButtonList1");  
  for(i=0;i<obj.length;i++)  
  {  
  if(obj[i].checked)  
  {  
    str=obj[i].value;  
  }  
  //str=CheckBoxSet.value;  
  }  
  return   str;  
  }Top

2 楼czhenq(...... fucking life. I want to change.)回复于 2005-06-02 01:38:52 得分 0

需使用name的值,不能使用id的值Top

相关问题

  • 为什么得不到值?
  • 为什么获得不到combobox的值?
  • wo为什么得不到I的值。
  • 为什么得不到@@identity的值?
  • 为什么得不到控件的值?
  • 为什么得不到DropDownList的值?
  • 为什么VBS函数得不到JS传过去的值?
  • 为什么得不到当前值呢 求救
  • 为什么得不到iCount的值?for不能循环
  • 为什么得不到文本框的值?

关键词

  • document
  • radiobuttonlist1
  • 得不到
  • 值
  • checkbox
  • str
  • var

得分解答快速导航

  • 帖主:clkun

相关链接

  • CSDN .NET频道
  • .NET类图书
  • C#类图书
  • .NET类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo