HTML中的代码
<div class="layui-form-item"> <div class="layui-inline"> <label for="bizUserId" class="layui-form-label" style=" 150px"> <span class="x-red">*</span>用户编号 </label> <div class="layui-input-inline" style=" 300px"> <input type="text" id="bizUserId" name="bizUserId" autocomplete="off" class="layui-input"/> </div> </div> <div class="layui-inline"> <button class="layui-btn" lay-filter="generate" lay-submit="">生成用户编号</button> </div> </div>
JS的控制程序
form.on('submit(generate)',function (data) {
$("#bizUserId").val(createUUID());
return false;
});
});