html
<div class="layui-inline">
<label class="layui-form-label">查询条件:</label>
<div class="layui-input-inline">
<select name="modules" lay-verify="required" lay-search="" id="condition" lay-filter="myselect">
<option value="3">公司名称</option>
<option value="2">账号</option>
</select>
</div>
</div>
<li class="layui-nav-item"><a href="#" id="loginout">退了</a></li>
<dl class="layui-nav-child">
<dd><a id="jump">基本资料</a></dd>
<dd><a href="">安全设置</a></dd>
</dl>
js
<script src="../layui/layui.js"></script>
<script>
layui.use(['element', 'layer','form'], function () {
var $ = layui.jquery;
var form = layui.form;
var element = layui.element;//Tab的切换功能,切换事件监听等,需要依赖element模块
var layer = layui.layer;
$(document).on('click', '#loginout', function () { //触发事件
window.location.href = "login.html";
});
$(document).on('click', '#jump', function () { //弹出编内框
//页面层
layer.open({
type : 2,
title : '添加资产',
area : [ '500px', '500px' ],
fix : false, //
content : '3.html',
end : function() {
dataTable.reloadTable();
}
});
});
//【layui】layer关闭当前窗口并刷新父页面
function close(status){
if(status=="yes"){ //yes为提交按钮
window.parent.location.reload();//刷新父页面
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
parent.layer.close(index);
}
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
parent.layer.close(index);
}
//layui 的select 出发事件 引入form
form.on('select(myselect)', function(data){
$("#condition").val()
});
</script>
为空的校验
lay-verify="required"
<div class="layui-inline">
<input type="text" name="keyword" id="keyword" placeholder="请输入会员用户名" autocomplete="off" lay-verify="required" class="layui-input">
</div>
网友评论