<i id='k35S6'><tr id='k35S6'><dt id='k35S6'><q id='k35S6'><span id='k35S6'><b id='k35S6'><form id='k35S6'><ins id='k35S6'></ins><ul id='k35S6'></ul><sub id='k35S6'></sub></form><legend id='k35S6'></legend><bdo id='k35S6'><pre id='k35S6'><center id='k35S6'></center></pre></bdo></b><th id='k35S6'></th></span></q></dt></tr></i><div id='k35S6'><tfoot id='k35S6'></tfoot><dl id='k35S6'><fieldset id='k35S6'></fieldset></dl></div>

    <small id='k35S6'></small><noframes id='k35S6'>

    <tfoot id='k35S6'></tfoot>

      <bdo id='k35S6'></bdo><ul id='k35S6'></ul>

      1. <legend id='k35S6'><style id='k35S6'><dir id='k35S6'><q id='k35S6'></q></dir></style></legend>

        使用layui弹出层layer.open弹出需要的表单

        时间:2024-10-18
            <legend id='PEiyt'><style id='PEiyt'><dir id='PEiyt'><q id='PEiyt'></q></dir></style></legend>
              <tbody id='PEiyt'></tbody>

            <i id='PEiyt'><tr id='PEiyt'><dt id='PEiyt'><q id='PEiyt'><span id='PEiyt'><b id='PEiyt'><form id='PEiyt'><ins id='PEiyt'></ins><ul id='PEiyt'></ul><sub id='PEiyt'></sub></form><legend id='PEiyt'></legend><bdo id='PEiyt'><pre id='PEiyt'><center id='PEiyt'></center></pre></bdo></b><th id='PEiyt'></th></span></q></dt></tr></i><div id='PEiyt'><tfoot id='PEiyt'></tfoot><dl id='PEiyt'><fieldset id='PEiyt'></fieldset></dl></div>

            <small id='PEiyt'></small><noframes id='PEiyt'>

                  <bdo id='PEiyt'></bdo><ul id='PEiyt'></ul>

                  <tfoot id='PEiyt'></tfoot>
                • 使用layui弹出层layer.open弹出需要的表单,弹出层表单很常见,也很实用,无论是在pc端网页还是在移动端。现在用layui来实现一下这个表单吧.
                  1、html部分,也就是要弹出的内容:
                  <form class="layui-form" id="test" style="display:none">
                    <div class="layui-form-item">
                      <label class="layui-form-label">输入框</label>
                      <div class="layui-input-block">
                        <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="on" class="layui-input" id="username" style="width:100px">
                      </div>
                    </div>
                    <div class="layui-form-item">
                      <label class="layui-form-label">密码框</label>
                      <div class="layui-input-inline">
                        <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="on" class="layui-input">
                      </div>
                      <div class="layui-form-mid layui-word-aux">辅助文字</div>
                    </div>
                    <div class="layui-form-item">
                      <label class="layui-form-label">选择框</label>
                      <div class="layui-input-block">
                       <select name="quiz" lay-search>
                    <option value="">请选择</option>
                    <optgroup label="城市记忆">
                      <option value="你工作的第一个城市">你工作的第一个城市?</option>
                    </optgroup>
                    <optgroup label="学生时代">
                      <option value="你的工号">你的工号?</option>
                      <option value="你最喜欢的老师">你最喜欢的老师?</option>
                    </optgroup>
                  </select>
                      </div>
                    </div>
                    <div class="layui-form-item">
                      <label class="layui-form-label">复选框</label>
                      <div class="layui-input-block">
                        <input type="checkbox" name="like[write]" title="写作" lay-skin="primary">
                        <input type="checkbox" name="like[read]" title="阅读" checked lay-skin="primary">
                        <input type="checkbox" name="like[dai]" title="发呆" lay-skin="primary">
                      </div>
                    </div>
                    <div class="layui-form-item">
                      <label class="layui-form-label">开关</label>
                      <div class="layui-input-block">
                        <input type="checkbox" name="switch" lay-skin="switch" lay-text="开启|关闭">
                      </div>
                    </div>
                    <div class="layui-form-item">
                      <label class="layui-form-label">单选框</label>
                      <div class="layui-input-block">
                        <input type="radio" name="sex" value="男" title="男">
                        <input type="radio" name="sex" value="女" title="女" checked>
                      </div>
                    </div>
                    <div class="layui-form-item layui-form-text">
                      <label class="layui-form-label" >文本域</label>
                      <div class="layui-input-block">
                        <textarea lay-verify="required" name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
                      </div>
                    </div>
                  </form>
                  <button id="div">提交</button>
                  
                  js代码部分,点击弹出的js事件:
                  layer.open({
                   type:1,
                   area:['500px','600px'],
                    title: 'tianxie'
                    ,content: $("#test"),
                    shade: 0,
                    btn: ['提交', '重置']
                    ,btn1: function(index, layero){
                    var kk=$("#username").val();
                    alert(kk);
                    },
                    btn2: function(index, layero){
                     alert("2222");
                     return false;
                    },
                  cancel: function(layero,index){ 
                     layer.closeAll();
                    }
                  
                  }); 
                  
                   
                  上一篇:js实现两个输入框输入数字自动相加显示在第三个输入框 下一篇:没有了

                  相关文章

                  <i id='oayLm'><tr id='oayLm'><dt id='oayLm'><q id='oayLm'><span id='oayLm'><b id='oayLm'><form id='oayLm'><ins id='oayLm'></ins><ul id='oayLm'></ul><sub id='oayLm'></sub></form><legend id='oayLm'></legend><bdo id='oayLm'><pre id='oayLm'><center id='oayLm'></center></pre></bdo></b><th id='oayLm'></th></span></q></dt></tr></i><div id='oayLm'><tfoot id='oayLm'></tfoot><dl id='oayLm'><fieldset id='oayLm'></fieldset></dl></div>

                  <small id='oayLm'></small><noframes id='oayLm'>

                      <tfoot id='oayLm'></tfoot>
                        <bdo id='oayLm'></bdo><ul id='oayLm'></ul>
                      <legend id='oayLm'><style id='oayLm'><dir id='oayLm'><q id='oayLm'></q></dir></style></legend>