• 表单字典


                <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);
                }
            }

  • 相关阅读:
    《JavaScript 闯关记》之初探
    《JavaScript 闯关记》之简介
    《JavaScript 闯关记》
    JavaScript检测之basevalidate.js
    如何排版 微信公众号「代码块」
    android开发之路03
    android开发之路02(浅谈BroadcastReceiver)
    android开发之路01
    软件工程复习(一)
    软件工程—人件(一)
  • 原文地址:https://www.cnblogs.com/csjoz/p/15247255.html
Copyright © 2020-2023  润新知