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

    2. <tfoot id='0HPYx'></tfoot>
    3. <legend id='0HPYx'><style id='0HPYx'><dir id='0HPYx'><q id='0HPYx'></q></dir></style></legend>
        <bdo id='0HPYx'></bdo><ul id='0HPYx'></ul>

      layui获取table中select值的办法

      时间:2023-10-08
    4. <tfoot id='LYLCC'></tfoot>
          <bdo id='LYLCC'></bdo><ul id='LYLCC'></ul>
          <legend id='LYLCC'><style id='LYLCC'><dir id='LYLCC'><q id='LYLCC'></q></dir></style></legend>

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

              <tbody id='LYLCC'></tbody>

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

                 
                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>
                代码解析:

                上一篇:Ajax中文传值出现乱码的解决办法 下一篇:没有了

                相关文章

                最新文章

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

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

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