选中特定单选按钮后 后面的text表单才可以使用,否则disabled。

 <form method="post" action="">
    <table>
    <tr><td><input type="radio" name="id"></td><td>id1</td></tr>
    <tr><td><input type="radio" name="id"></td><td>id2</td></tr>
    <tr><td><input type="radio" name="id" checked></td><td>other</td></tr>
    </table>
    <table>
        <tr><td><input type="text" name="name"></td></tr>
        <tr><td><input type="text" name="pw"></td></tr>
    </table>
    <input type="submit" value="submit">
</form>
想要默认选中的是other,并且后面的两个表单可用,当切换到其他选项时,后面的表单disabled,选中other时可用。
实在木有C币了,麻烦大侠了

第二种方法:****

 <html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
</head>

<script>
function change1()
{

    var name=document.getElementsByName('name')[0];
    var pw=document.getElementsByName("pw")[0];
    name.disabled="disabled";
    pw.disabled="disabled";


}

function change2()
{

    var name=document.getElementsByName('name')[0];
    var pw=document.getElementsByName("pw")[0];
    name.disabled="";
    pw.disabled="";


}

</script>

<body>
<form method="post" action="">
    <table>
    <tr><td><input type="radio" name="id" onclick="change1()"></td><td>id1</td></tr>
    <tr><td><input type="radio" name="id" onclick="change1()"></td><td>id2</td></tr>
    <tr><td><input type="radio" name="id" checked onclick="change2()"></td><td>other</td></tr>
    </table>
    <table id="change">
        <tr><td><input type="text" name="name"></td></tr>
        <tr><td><input type="text" name="pw"></td></tr>
    </table>
    <input type="submit" value="submit" onclick="change()">
</form>
</body>
</html>
 4、让某个radio置于选中状态。

        $("input:radio[name='dialCheckResult']").eq(0).attr("checked",true);

5、让页面中“未选中”状态的radio不可用。

       $("input:radio:not([checked])").attr("disabled","disabled");

6、遍历选中状态的radio,除了某一个radio之外,其他的“选中”状态的radio设定是“未选中”状态。

      $('input:radio:checked').each(function(i,val){
            if(val.name != "dialCheckResult" ){
           $("input:radio[name='"+val.name+"']:checked").attr('checked',false);
           }
     });




function change1() { var ch=document.getElementById("change"); var var_ch=""; ch.innerHTML=var_ch; } function change2() { var ch=document.getElementById("change"); var var_ch='<tr><td><input type="text" name="name"></td></tr><tr><td><input type="text" name="pw"></td></tr>'; ch.innerHTML=var_ch; }

id1
id2
other



 <html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
</head>

<script>
function change1()
{

    var ch=document.getElementById("change");

    var var_ch="";
    ch.innerHTML=var_ch;

}

function change2()
{

    var ch=document.getElementById("change");

    var var_ch='<tr><td><input type="text" name="name"></td></tr><tr><td><input type="text" name="pw"></td></tr>';
    ch.innerHTML=var_ch;


}

</script>

<body>
<form method="post" action="">
    <table>
    <tr><td><input type="radio" name="id" onclick="change1()"></td><td>id1</td></tr>
    <tr><td><input type="radio" name="id" onclick="change1()"></td><td>id2</td></tr>
    <tr><td><input type="radio" name="id" checked onclick="change2()"></td><td>other</td></tr>
    </table>
    <table id="change">
        <tr><td><input type="text" name="name"></td></tr>
        <tr><td><input type="text" name="pw"></td></tr>
    </table>
    <input type="submit" value="submit" onclick="change()">
</form>
</body>
</html>

<form method="post" action="">
    <table>
    <tr><td><input type="radio" name="id" onclick="change1()"></td><td>id1</td></tr>
    <tr><td><input type="radio" name="id" onclick="change1()"></td><td>id2</td></tr>
    <tr><td><input type="radio" name="id" checked onclick="change2()"></td><td>other</td></tr>
    </table>
    <table id="change">
        <tr><td><input type="text" name="name"></td></tr>
        <tr><td><input type="text" name="pw"></td></tr>
    </table>
    <input type="submit" value="submit" onclick="change()">
</form>


第一种方法****

 <html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
</head>

<script>
function change1()
{

    var ch=document.getElementById("change");

    var var_ch="";
    ch.innerHTML=var_ch;

}

function change2()
{

    var ch=document.getElementById("change");

    var var_ch='<tr><td><input type="text" name="name"></td></tr><tr><td><input type="text" name="pw"></td></tr>';
    ch.innerHTML=var_ch;


}

</script>

<body>
<form method="post" action="">
    <table>
    <tr><td><input type="radio" name="id" onclick="change1()"></td><td>id1</td></tr>
    <tr><td><input type="radio" name="id" onclick="change1()"></td><td>id2</td></tr>
    <tr><td><input type="radio" name="id" checked onclick="change2()"></td><td>other</td></tr>
    </table>
    <table id="change">
        <tr><td><input type="text" name="name"></td></tr>
        <tr><td><input type="text" name="pw"></td></tr>
    </table>
    <input type="submit" value="submit" onclick="change()">
</form>
</body>
</html>
 <!DOCTYPE HTML>
<html>
<script>
 function aa(str){
if(str=="2"){
document.getElementById("name").style.display="none";
document.getElementById("pw").style.display="none";
}else{
document.getElementById("name").style.display="";
document.getElementById("pw").style.display="";
}

}
</script>
<body>
<form method="post" action="">
    <table>
    <tr><td><input type="radio" name="id" onclick="aa(1)"></td><td>id1</td></tr>
    <tr><td><input type="radio" name="id" onclick="aa(1)"></td><td>id2</td></tr>
    <tr><td><input type="radio" name="id" onclick="aa(2)" checked></td><td>other</td></tr>
    </table>
    <table>
        <tr><td><input id="name" type="text" name="name"></td></tr>
        <tr><td><input id="pw" type="text" name="pw"></td></tr>
    </table>
    <input type="submit" value="submit">
</form>
</body>
</html>