无法检查/取消选中手风琴小部件中的单选按钮

时间:2013-11-04 12:01:57

标签: jquery-ui-accordion

我无法检查/取消选中Accordion小部件中的单选按钮。

这是我的代码:

<SCRIPT LANGUAGE="JavaScript">
    $(function() {
        $( "#accordion" ).accordion();
    });   
</SCRIPT> 

<div id="accordion" >
    <input type="radio" id="worddoc"  name="submissionType">Upload Word
    <div>
        <input type="file"/>
    </div>
    <input type="radio" id="pdfdoc" name="submissionType">Upload Pdf
    <div>
        <input type="file"/>             
    </div>
</div>

2 个答案:

答案 0 :(得分:0)

检查

<SCRIPT LANGUAGE="JavaScript">
            $(function() {
                $( "#accordion" ).accordion();
            });   
  </SCRIPT> 

<div id="accordion" >
    <div>
        <input type="radio" id="worddoc"  name="submissionType"> Upload Word
        <input type="file"/>
    </div>
    <div>
        <input type="radio" id="pdfdoc" name="submissionType">Upload Pdf
        <input type="file"/>             
    </div>
</div>

答案 1 :(得分:0)

您只需为每个手风琴选项添加标题,如下所示:

<div id="accordion" >
    <h1>Option 1</h1>
    <div>
        <input type="radio" id="worddoc"  name="submissionType" /> Upload Word
        <input type="file"/>
    </div>
    <h1>Option 2</h1>
    <div>
        <input type="radio" id="pdfdoc" name="submissionType" />Upload Pdf
        <input type="file"/>             
    </div>
</div>

<script>
    $(function() {
        $("#accordion").accordion();
    });
</script>

JSFiddle。如果这不是您的意思,请告诉我。