<legend id='jzegu'><style id='jzegu'><dir id='jzegu'><q id='jzegu'></q></dir></style></legend>

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

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

        layui如何才能得到select的值

        时间:2023-10-08
        <i id='dDIR4'><tr id='dDIR4'><dt id='dDIR4'><q id='dDIR4'><span id='dDIR4'><b id='dDIR4'><form id='dDIR4'><ins id='dDIR4'></ins><ul id='dDIR4'></ul><sub id='dDIR4'></sub></form><legend id='dDIR4'></legend><bdo id='dDIR4'><pre id='dDIR4'><center id='dDIR4'></center></pre></bdo></b><th id='dDIR4'></th></span></q></dt></tr></i><div id='dDIR4'><tfoot id='dDIR4'></tfoot><dl id='dDIR4'><fieldset id='dDIR4'></fieldset></dl></div>
          1. <legend id='dDIR4'><style id='dDIR4'><dir id='dDIR4'><q id='dDIR4'></q></dir></style></legend>

              <tbody id='dDIR4'></tbody>
            <tfoot id='dDIR4'></tfoot>

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

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

                  layui得到select值的方法:首先打开相应的代码文件;然后引用layui插件;最后通过“var batch=$("#batch").val();”方法取得下拉框的值即可。具体代码如下:
                  <!DOCTYPE html>
                  <html>
                  <head>
                    <meta charset="utf-8">
                    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
                    <title>增加、修改学校/层次/专业</title>
                    <link rel="stylesheet" href="layui/layui.css">
                  </head>
                  <body>
                  <div class="layui-fluid layui-form">
                  <form class="layui-form" action="" method="post">
                  <br>
                            <div style="padding-left: 100px; padding-bottom: 20px;"><h2>{$rs1.title} >> {$rs.title}</h2></div>
                            <div class="layui-form-item">
                              <label class="layui-form-label">学费</label>
                              <div class="layui-input-block">
                                <input type="text" name="price" required  lay-verify="required" class="layui-input" value="{$rs.price}" readonly>
                              </div>
                            </div>
                            <div class="layui-form-item">
                              <label class="layui-form-label">批次</label>
                              <div class="layui-input-block">
                  <select name="batch" id="batch" lay-filter="batch" lay-verify="required" lay-search="required">
                                     <option value="">请选择批次</option>
                                    {volist name="batch_rs" id="batch"}
                      <option value="{$batch.id}" {if condition="$rsEdit.batch eq $batch.id"}selected{/if}>{$batch.title}</option>
                      {/volist}
                  </select>  
                              </div>
                            </div>
                            <div class="layui-form-item">
                              <div class="layui-input-block">
                                <button type="button" id="editbatchschooltuition" class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                              </div>
                            </div>
                  </form>
                  </div>
                  <script src="layui/layui.js"></script>
                  <script>
                  layui.use(['form', 'jquery'], function(){
                    var form = layui.form
                    ,$= layui.$;
                    
                  // var batch=$("#batch").val();
                     
                  form.on('select', function(data){
                    console.log(data.elem); //得到select原始DOM对象
                    console.log(data.value); //得到被选中的值]
                    $("#batch").val(data.value)
                    console.log(data.othis); //得到美化后的DOM对象
                  });  
                     
                    $('#editbatchschooltuition').on('click', function(){
                    var batch=$("#batch").val();
                    alert(batch);
                  layer.ready(function(){ 
                    layer.open({
                  type: 2,
                  title: '增加',
                  maxmin: true,
                  area: ['750px', '400px'],
                  content: '{:url('main/addschool')}?id={$id}&price={$rs.price}&batch='+batch,
                  //content: '{:url('main/addschool')}',
                  cancel: function(){ //刷新网页
                    }
                    });
                  });
                  });
                    
                  });
                  </script>
                  </body>
                  </html>
                  代码解析:

                  上一篇:layer出现Uncaught ReferenceError: layer is not defined错误 下一篇:没有了

                  相关文章

                1. <tfoot id='eVzmN'></tfoot>
                      <bdo id='eVzmN'></bdo><ul id='eVzmN'></ul>
                  1. <i id='eVzmN'><tr id='eVzmN'><dt id='eVzmN'><q id='eVzmN'><span id='eVzmN'><b id='eVzmN'><form id='eVzmN'><ins id='eVzmN'></ins><ul id='eVzmN'></ul><sub id='eVzmN'></sub></form><legend id='eVzmN'></legend><bdo id='eVzmN'><pre id='eVzmN'><center id='eVzmN'></center></pre></bdo></b><th id='eVzmN'></th></span></q></dt></tr></i><div id='eVzmN'><tfoot id='eVzmN'></tfoot><dl id='eVzmN'><fieldset id='eVzmN'></fieldset></dl></div>
                  2. <small id='eVzmN'></small><noframes id='eVzmN'>

                    <legend id='eVzmN'><style id='eVzmN'><dir id='eVzmN'><q id='eVzmN'></q></dir></style></legend>