Js获取radiobuttonlist选中值完整代码

时间:2022-02-26 21:54:42
<% @ Page language = " c# "  Codebehind = " WebForm1.aspx.cs "  AutoEventWireup = " false "  Inherits = " ajaxselect.OnmouseTitle.WebForm1 "  %>
Js获取radiobuttonlist选中值完整代码
<! DOCTYPE HTML PUBLIC  " -//W3C//DTD HTML 4.0 Transitional//EN "  >
Js获取radiobuttonlist选中值完整代码
< HTML >
Js获取radiobuttonlist选中值完整代码    
< HEAD >
Js获取radiobuttonlist选中值完整代码        
< title > WebForm1 </ title >
Js获取radiobuttonlist选中值完整代码        
< meta content = " Microsoft Visual Studio .NET 7.1 "  name = " GENERATOR " >
Js获取radiobuttonlist选中值完整代码        
< meta content = " C# "  name = " CODE_LANGUAGE " >
Js获取radiobuttonlist选中值完整代码        
< meta content = " JavaScript "  name = " vs_defaultClientScript " >
Js获取radiobuttonlist选中值完整代码        
< meta content = " http://schemas.microsoft.com/intellisense/ie5 "  name = " vs_targetSchema " >
Js获取radiobuttonlist选中值完整代码        
< script language = " javascript " >
Js获取radiobuttonlist选中值完整代码        
Js获取radiobuttonlist选中值完整代码       
Js获取radiobuttonlist选中值完整代码         function  getvalue()
Js获取radiobuttonlist选中值完整代码Js获取radiobuttonlist选中值完整代码        
{
Js获取radiobuttonlist选中值完整代码        var b
=document.all.rbtid.length
Js获取radiobuttonlist选中值完整代码        var a
=document.getElementById("rbtid").rows.length; 
Js获取radiobuttonlist选中值完整代码        
//alert(b);结果为5
Js获取radiobuttonlist选中值完整代码        
//alert(a);结果为4
Js获取radiobuttonlist选中值完整代码        
//for(var i=0;i<b-1;i++)这样也行
Js获取radiobuttonlist选中值完整代码
        for(var i=0;i<a;i++)
Js获取radiobuttonlist选中值完整代码Js获取radiobuttonlist选中值完整代码        
{
Js获取radiobuttonlist选中值完整代码          var ss
="rbtid_"+i;
Js获取radiobuttonlist选中值完整代码          var aa
=document.getElementById(ss).value;
Js获取radiobuttonlist选中值完整代码          
//if(eval('document.all.rbtid_'+i).checked==true) //这样也行 eval()函数能将数据符串转成js运行
Js获取radiobuttonlist选中值完整代码
          var bb=document.getElementById(ss);
Js获取radiobuttonlist选中值完整代码          
if(document.getElementById(ss).checked)  //注意checked不能写成Checked,要不然不成功
Js获取radiobuttonlist选中值完整代码Js获取radiobuttonlist选中值完整代码
           {
Js获取radiobuttonlist选中值完整代码                  alert(aa);
Js获取radiobuttonlist选中值完整代码                  
break;
Js获取radiobuttonlist选中值完整代码           }
      
Js获取radiobuttonlist选中值完整代码        
Js获取radiobuttonlist选中值完整代码        }

Js获取radiobuttonlist选中值完整代码        }

Js获取radiobuttonlist选中值完整代码        
</ script >
Js获取radiobuttonlist选中值完整代码    
</ HEAD >
Js获取radiobuttonlist选中值完整代码    
< body MS_POSITIONING = " GridLayout " >
Js获取radiobuttonlist选中值完整代码        
< form id = " Form1 "  method = " post "  runat = " server " >
Js获取radiobuttonlist选中值完整代码            
< FONT face = " 宋体 " >
Js获取radiobuttonlist选中值完整代码                
< asp:radiobuttonlist id = " rbtid "  style = " Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px "  runat = " server "
Js获取radiobuttonlist选中值完整代码                    Width
= " 216px "  Height = " 176px "  name = " rbtid " >
Js获取radiobuttonlist选中值完整代码                    
< asp:ListItem Value = " 0 " > 0 </ asp:ListItem >
Js获取radiobuttonlist选中值完整代码                    
< asp:ListItem Value = " 1 "  Selected > 1 </ asp:ListItem >
Js获取radiobuttonlist选中值完整代码                    
< asp:ListItem Value = " 2 " > 2 </ asp:ListItem >
Js获取radiobuttonlist选中值完整代码                    
< asp:ListItem Value = " 3 " > 3 </ asp:ListItem >
Js获取radiobuttonlist选中值完整代码                
</ asp:radiobuttonlist >< INPUT style = " Z-INDEX: 102; LEFT: 184px; POSITION: absolute; TOP: 256px "  onclick = " getvalue() "
Js获取radiobuttonlist选中值完整代码                    type
= " button "  value = " Button " ></ FONT >
Js获取radiobuttonlist选中值完整代码        
</ form >
Js获取radiobuttonlist选中值完整代码    
</ body >
Js获取radiobuttonlist选中值完整代码
</ HTML >