Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the layui front-end framework to pop up form forms and submit

Shulou Source: shulou.com Published: 2022-06-03 10:58:41 11月15日 Update

这篇文章主要介绍怎么用layui前端框架弹出form表单以及提交,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

第一步:引用两个文件

第二步:点击删除按钮弹出提示框

/*删除开始*/$(".del").click(function () {var id = $(this).attr("id");layer.alert('您确定要删除操作吗?', {skin: 'layui-layer-molv' //样式类名 自定义样式, closeBtn: 1 // 是否显示关闭按钮, anim: 1 //动画类型, btn: ['确定', '取消'] //按钮, icon: 6 // icon, yes: function () {//layer.msg('确定')$.ajax({type: "POST",url: "@Url.Action("Delete", "UserInfo")",data: { id: id },success: function (Data) {if (Data == "ok") {location.reload();}else {layer.msg('删除失败')}},error: function () {alert("出现错误");return false;}}) //ajax结束}, btn2: function () {layer.msg('取消')}});})/*删除结束*/

第三步:放一个添加按钮

Tags: Button form page front end frame information content style article two value address interest animation name guy buddy that is attribute age Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker OPPO Reno Redmi Xiaomi NVidia