formSelects 4.x多选下拉框

こ雲淡風輕ζ 提交于 2020-05-05 18:08:36

需先引入:

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>

 

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

    formSelects.on('select_base_cityname', function (id,vals,val,isAdd,isDisabled) {
       
        var getName = layui.formSelects.value('select_base_cityname');//取值
        
        layer.msg("你选择的值为:" + getName);
    });

});

 

https://hnzzmsf.github.io/example/example_v4.html#options 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!