2个连续的<select>:第2个未呈现

时间:2019-06-14 13:57:16

标签: html twitter-bootstrap twitter-bootstrap-3

我有一个JSP,提供了包含表单的引导程序模式。在这种形式下,我有2个连续的select标签,但只有第一个被渲染

<div class="form-group"><label>Domaine Responsable (par défaut) :</label><select name="domaineResponsable" class="form-control form-control-sm"/></div>
<div class="form-group"><label>Remise :</label><select name="paramRemiseS2Vues" class="form-control form-control-sm"/></div>                
<div class="form-check"><input name="effetSeuil" type="checkbox" class="form-check-input"/><label class="form-check-label" for="effetSeuil">Effet de seuil ?</label></div>

如果我在2个选择之间添加另一种输入,则两个选择都将正确呈现

全模态:

<div id="creationRapportModal" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&#215;</button>
                <h4 class="modal-title">Création du rapport</h4>
            </div>
            <form id="formCreate" autocomplete="off" >
                <div class="modal-body">
                    <div class="form-group">
                        <label>Code :</label>
                        <input name="code" class="form-control"/>
                    </div>
                    <div class="form-group">
                        <label>Ancien Code :</label>
                        <input name="ancienCode" class="form-control"/>
                    </div>
                    <div class="form-group">
                        <label>Nom de l'état :</label>
                        <input name="nomEtat" class="form-control"/>
                    </div>
                    <div class="form-group">
                        <label>Nom du report :</label>
                        <input name="reportName" class="form-control"/>
                    </div>
                    <div class="form-group">
                        <label>Domaine Responsable (par défaut) :</label>
                        <select name="domaineResponsable" class="form-control form-control-sm"/>
                    </div>
                    <div class="form-group">
                        <label>Remise :</label>
                        <select name="paramRemiseS2Vues" class="form-control form-control-sm"/>
                    </div>
                    <div class="form-check">
                        <input name="effetSeuil" type="checkbox" class="form-check-input"/>
                        <label class="form-check-label" for="effetSeuil">Effet de seuil ?</label>
                    </div>
                            <input type="hidden" name="id" />
                </div>
                <div class="modal-footer">
                    <button id="createBouton" class="btn btn-primary">Créer</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                </div>
            </form>
        </div>
    </div>
</div>

2 个答案:

答案 0 :(得分:1)

问题与选择的结束标记。

Select不是类似于input的自闭标签。应使用

关闭
            <div class="form-group"><label>Domaine Responsable (par défaut) :</label><select name="domaineResponsable" class="form-control form-control-sm"></select></div>
            <div class="form-group"><label>Remise :</label><select name="paramRemiseS2Vues" class="form-control form-control-sm"></select></div>  

更新的代码

<div id="creationRapportModal" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&#215;</button>
                <h4 class="modal-title">Création du rapport</h4>
            </div>

            <form id="formCreate" autocomplete="off" >
                <div class="modal-body">
                    <div class="form-group"><label>Code :</label><input name="code" class="form-control"/></div>
                    <div class="form-group"><label>Ancien Code :</label><input name="ancienCode" class="form-control"/></div>
                    <div class="form-group"><label>Nom de l'état :</label><input name="nomEtat" class="form-control"/></div>
                    <div class="form-group"><label>Nom du report :</label><input name="reportName" class="form-control"/></div>
                    <div class="form-group"><label>Domaine Responsable (par défaut) :</label><select name="domaineResponsable" class="form-control form-control-sm"></select></div>
                    <div class="form-group"><label>Remise :</label><select name="paramRemiseS2Vues" class="form-control form-control-sm"></select></div>                
                    <div class="form-check"><input name="effetSeuil" type="checkbox" class="form-check-input"/><label class="form-check-label" for="effetSeuil">Effet de seuil ?</label></div>
                    <input type="hidden" name="id" />
                </div>
                <div class="modal-footer">
                    <button id="createBouton" class="btn btn-primary">Créer</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
                </div>
            </form> 
        </div>
    </div>
</div>

答案 1 :(得分:0)

实际上,答案不起作用。在模态之外,我有以下代码存在类似的问题:

            <div class="panel-body">
            <div class="container-fluid">
                <form autocomplete="off" id="searchForm">
                <div class="row">
                    <div class="col-sm-3">
                        Marques : <select multiple="multiple" id="searchListMarques"> </select> test
                    </div>
                    <div class="col-sm-3">
                        Solos : <select multiple="multiple" id="searchListSolos"> </select>
                    </div>                  
                    <div class="col-sm-3">                  
                        Remises : <select multiple="multiple" id="searchListRemises"> </select>
                    </div>
                </div>
                </form>
            </div>
        </div>

第二个选择未呈现...