码迷,mamicode.com
首页 > 其他好文 > 详细

formSelects 4.x多选下拉框

时间:2019-08-05 00:07:46      阅读:348      评论:0      收藏:0      [点我收藏+]

标签:getname   upload   undefined   string   layer   btn   button   天津   option   

需先引入:

formSelects-v4.css

formSelects-v4.js

插件下载地址:https://fly.layui.com/extend/formSelects

 

使用:

<div class="layui-form">
    <div class="layui-input-inline">
        <select name="select_base_cityname" id="select_base_cityname" lay-filter="select_base_cityname" xm-select="select_base_cityname" xm-select-type="1">
            <option value=""></option>
            <option value="1">北京</option>
            <option value="2">上海</option>
            <option value="3">天津</option>
            <option value="4">重庆</option>
        </select>
    </div>
<div class="layui-row ">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<button type="button" class="layui-btn layui-btn-danger" lay-submit lay-filter="btn_submit" id="btn_submit"><i class="layui-icon">&#xe681</i>获取</button>
</div>
</div>

 

layui.use([‘form‘, ‘layer‘, ‘jquery‘, ‘table‘, ‘laydate‘, ‘element‘, ‘upload‘, ‘flow‘], function () {
    var $$ = layui.jquery;
    var form = layui.form,
        layer = parent.layer == undefined ? layui.layer : parent.layer,
        //layer = layui.layer,
        table = layui.table,
        laydate = layui.laydate,
        element = layui.element,
        upload = layui.upload,
        flow = layui.flow;
    form.render();

    form.on(‘submit(btn_submit)‘, function (obj) {
       
        var getName = JSON.stringify(layui.formSelects.value(‘select_base_cityname‘, ‘name‘));//取值name数组
        /*layer.msg("你选择的值为:" + getName, { offset: ‘150px‘, icon: 1, time: 5000 }, function () {                  
        });*/
        layer.msg("你选择的值为:" + getName);
    });

});

 

formSelects 4.x多选下拉框

标签:getname   upload   undefined   string   layer   btn   button   天津   option   

原文地址:https://www.cnblogs.com/hhthtt/p/11300534.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!