要实现两个单选radio,一个被选中,则两个文本框disabled,而另一个被选中,则两个文本框enabled,即可以输入拉.
现在反复点一个radio,则文本框始终可以输入,请大家帮忙,给出代码最好拉,谢谢.

解决方案 »

  1.   

    <form>
    <input type="text" name="t1" id="t1" value="t1"/>
    <input type="text" name="t2" id="t2" value="t2"/><br/>
    <input type="radio" name="r" id="r1" value="true" onclick="showInput(true)" checked/>Enable<br/>
    <input type="radio" name="r" id="r2" value="false"  onclick="showInput(false)"/>Disable
    </form>
    <script type="text/javascript">
      function showInput(show){
        document.getElementById("t1").disabled = !show;
        document.getElementById("t2").disabled = !show;
      }
    </script>
      

  2.   

    java2000_net 晚上不睡觉的啊~_~?