我有以下设置:
<form action="?" method="post" name="contactform">
<div class="question">
<p><span><input type="radio" name="answer" value="Yes" onclick="showHide('one')"/></span> Yes</p>
</div>
<div id="one" class="answers" style="display:none">
<p><input type="radio" name="answerdetail" value="Reason One" /> Reason One</p>
<p><input type="radio" name="answerdetail" value="Reason Two" /> Reason Two</p>
<p><input type="radio" name="answerdetail" value="Reason Three" /> Reason Three</p>
</div><!-- end answers -->
<div class="question">
<p><span><input type="radio" name="answer" value="No" onclick="showHide('two')"/></span> No</p>
</div>
<div id="two" class="answers" style="display:none">
<p><input type="radio" name="answerdetail" value="Reason One" /> Reason One</p>
<p><input type="radio" name="answerdetail" value="Reason Two" /> Reason Two</p>
<p><input type="radio" name="answerdetail" value="Reason Three" /> Reason Three</p>
<p><input type="radio" name="answerdetail" value="Reason Four" /> Reason Four</p>
</div><!-- end answers -->
<div class="question">
<p><span><input type="radio" name="answer" value="Not sure" /></span> Not sure</p>
</div>
当您第一次看到表单时,只有 3 个复选框可见(是、否、不确定)。当您单击“是”时,会出现“是”的子复选框,如果您单击“否”,则会出现“否”的子复选框。
我想知道是否可以一次只显示一组子复选框?
即,如果有人选中“是”,则会出现“是”的子复选框。如果他们随后改变主意并单击“否”,则“是”的子复选框会消失,而“否”的子复选框会出现(即,任何时候都只能看到一组子复选框)。
我希望这是有道理的。
任何帮助将不胜感激!