控制写在radio控件的onclick事件里(2个都加),text控件加name属性以便访问

解决方案 »

  1.   

    小弟刚学javascript还不太清楚,请各位大侠把完整代码写出来
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title></head><body>
    <p>
      <input type="text" name="textfield">
    </p>
    <p>
      <input name="radiobutton" type="radio" value="radiobutton" onCLick="document.all.textfield.disabled=true"> 
      不可用
      <input type="radio" name="radiobutton" value="radiobutton" onCLick="document.all.textfield.disabled=false">
      可用</p>
    </body>
    </html>
      

  3.   

    现在出现新情况,请各位大侠指教:在<html:radio  value="no" property="radio"  />控件的onclick事件里写了:
    <script>
    function check()
    {document.Form.bs.disabled=ture;}
    </script>
    另一个radio控件是:document.Form.bs.disabled=false;
    可以实现选radio为no时文本框bs不能输入。
    但此页面提交操作成功后 , 弹出alert("操作成功!"), 点确定后此页面上radio还是no,
    但这时bs能输入了。 要如何解决这问题???
      

  4.   

    <script>
      function unCheckRadio() {
       var p = document.getElementsByTagName("INPUT")
       for (i=0;i<p.length;i++)
       {
        if (p[i].type == "radio")
        {
          p[i].checked = false
        }
       }
      }
    </script>
    <body onload="unCheckRadio()">