Layui 获取表单提交数据

HTML
<
div class="layui-card-header layuiadmin-card-header-auto"> <form class="layui-form"> <div class="layui-form-item"> <div class="layui-inline"> <label class="layui-form-label">公司名:</label> <div class="layui-input-inline"> <input name="keyword" id="keyword" class="layui-input"> </div> </div> <div class="layui-form-item layui-inline"> <button class="layui-btn" lay-submit lay-filter="formDemo">搜索</button> </div> </div> </form> </div>

 

JS

form.on('submit(formDemo)', function (data) {
     console.log(data.field);
     return false;
});

 

posted @ 2019-07-14 15:33  Skrillex  阅读(21907)  评论(0编辑  收藏  举报

power by Skrillex 2008