【问题标题】:Hide a dropdown list from a thymeleaf form隐藏百里香形式的下拉列表
【发布时间】:2018-11-08 01:00:30
【问题描述】:

我有一个带有默认值的下拉列表的 thymeleaf 表单。我去把它隐藏在表单中。

第一个是:

<div class="form-group">
                <label class="col-md-4 control-label" for="estado"></label>
                <div class="col-md-4">
                    <select id="estado" name="estado" class="form-control">
                        <option th:each="estado : ${estado}" th:value="${estado.idEstado}"
                            th:attr="choiceid=${estado.idEstado}" th:text="${estado.estado}"></option>
                    </select>
                </div>
            </div>

第二个是:

<div class="form-group">
                <label class="col-md-4 control-label" for="tipoDeDeclaracion"></label>
                <div class="col-md-4">

                    <select th:field="*{tieneErrores}" class="form-control"
                        name="project_status">
                        <option value="N">NO (por defecto)</option>
                    </select>
                </div>
            </div>

谢谢。

【问题讨论】:

    标签: html spring-mvc spring-boot thymeleaf


    【解决方案1】:

    感谢通过添加 style="display: none; 解决它

    <div class="form-group" style="display: none;">
                    <label class="col-md-4 control-label" for="tipoDeDeclaracion"></label>
                    <div class="col-md-4">
    
                        <select th:field="*{tieneErrores}" class="form-control"
                            name="project_status">
                            <option value="N">NO (por defecto)</option>
                        </select>
                    </div>
                </div>
    

    【讨论】:

      猜你喜欢
      • 2019-06-13
      • 2018-07-08
      • 2020-12-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-20
      • 2020-07-13
      相关资源
      最近更新 更多