我打算做一个表格,其中有个radio button的选项。这个radio button有三个选项,agree disagree 和 N/A,我希望当用户选择disagree的时候下面自动出现新的一行来询问为什么选择disagree如果实现这个需要用到什么技术啊如果是jquery ajax,大概的结构是什么啊

解决方案 »

  1.   

    <script type="text/javascript">
    function showwhy(){
    document.getElementById("why").style.display="";
    }
    function hidewhy(){
    document.getElementById("why").style.display="none";
    }
    </script>
    </head><body>
    <table id="table1">
    <tr>
    <td><input type="radio" name="test" onclick="hidewhy()" id="test1"><label for="test1">agree</label></td>
    <td><input type="radio" name="test" onclick="showwhy()" id="test2"><label for="test2">disagree</label></td>
    <td><input type="radio" name="test" onclick="hidewhy()" id="test3"><label for="test3">N/A</label></td>
    </tr>
    <tr style="display:none" id="why">
    <td colspan="3"><input type="text" value="为什么disagree"></td>
    </tr>
    </table>
    这样试试 ajax是异步传输  比如当即验证你的注册名是否已经被注册之类的  这里好像用不到吧?个人感觉  呵呵
      

  2.   


    是不是可以在显示 function里面引入一个功能让他去调取一个php的文件呢,