标签: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"></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);
});
});
标签:getname upload undefined string layer btn button 天津 option
原文地址:https://www.cnblogs.com/hhthtt/p/11300534.html