<input type='radio' disdabled id='radio' name='radio' value='T'/>
<input type='radio' disdabled id='radio' name='radio' value='F'/>
如何获得选中的radio的value值,麻烦说的详细些

解决方案 »

  1.   

    在jsp页面中
    <input type='radio' disdabled id='radio_1' name='ra_1' value='T'/>
    <input type='radio' disdabled id='radio_2' name='ra_1' value='F'/>在提交的jsp页面或servlet中获得该值:
    String ra = request.getParameter("ra_1");
      

  2.   

    在jsp 页面中以form形式提交
    <form action ="aa.jsp" method="post">
    <input type='radio' disdabled id='radio' name='radio' value='T'/>
    <input type='radio' disdabled id='radio' name='radio' value='F'/>
    </form>aa.jsp或者servlet中。直接用
    <%
      String radio = request.getParameter("radio");//得到的就是。你选中的radio的值。%>
      

  3.   

    如何在JavaScript中获得,而不是在servlet中获得
      

  4.   

    大侠们,是在JavaScript中获得,不是在后台类中获得
      

  5.   

      document.getElementById('radio_1').value;
      

  6.   

    function test()
    {
      var temp = document.getElementsByName("radHot");
      for(var i=0;i<temp.length;i++)
      {
         if(temp[i].checked)
               var intHot = temp[i].value;
      }
      

    http://zhidao.baidu.com/question/243362062.html  百度太多了
     document.getElementsByName 这个是获取同一名字标签的集合 
      

  7.   

    var chks=document.getElementsByName("radio");
         var nodes=$A(chks);
         nodes.each(function(node)
         {
         if(node.checked){
          。这就是你想要的
         }
         });
      

  8.   

    抱歉写错了,document.getElementByName('ra_1').value
      

  9.   

    这个应该就是在百度知道上搜的吧,我也看到了,但是temp.length好像不能执行啊
      

  10.   

    function check(){
        for(var i=0;i<radio.length;i++){
            if(radio[i].checked)
                alert(radio[i].value);
        }
    }
      

  11.   

    这个是对的,我查百度时在eclipse中写错了,汗……
      

  12.   

    ar val=$('input:radio[name="_objId"]:checked').val();