zoukankan      html  css  js  c++  java
  • 表单字典

                <li>
                    车间:<select name="memberRoom" th:with="type=${@dict.getType('team_member_room')}">
                    <option value="">所有</option>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                  </select>
                  </li>


     <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>

    ___________________________状态
                    <div class="col-sm-8">
                        <label class="toggle-switch switch-solid">
                            <input type="checkbox" id="status" checked>
                            <span></span>
                        </label>
                    </div>

      <div class="col-sm-8">
        <label class="toggle-switch switch-solid">
          <input type="checkbox" id="status" th:checked="${user.status == '0' ? true : false}">
          <span></span>
        </label>
      </div>
    ___________________________提交
       function submitHandler() {
                if ($.validate.form()) {
                    var data = $("#form-user-edit").serializeArray();
                    var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
                    data.push({"name": "status", "value": status});
                    $.operate.saveTab(prefix + "/edit", data);
                }
            }

            function submitHandler() {
                if ($.validate.form()) {
                    var data = $("#form-user-edit").serializeArray();
                    var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
                    var roleIds = $.form.selectCheckeds("role");
                    var postIds = $.form.selectSelects("post");
                    data.push({"name": "status", "value": status});
                    data.push({"name": "roleIds", "value": roleIds});
                    data.push({"name": "postIds", "value": postIds});
                    $.operate.saveTab(prefix + "/edit", data);
                }
            }

  • 相关阅读:
    Windows phone 应用开发系列教程(更新中)
    ios实例开发精品文章推荐(8.14)
    Android开发环境——调试器 DDMS相关内容汇总
    docker 发布应用时添加 git revision
    docker环境下数据库的备份(postgresql, mysql)
    golang web 方案
    golang 1.12 自动补全
    区块链简介
    天空的另一半
    Ecto中的changeset,schema,struct,map
  • 原文地址:https://www.cnblogs.com/csjoz/p/15247255.html
Copyright © 2011-2022 走看看