菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
24
0

asp.net表单提交时防重复提交并执行前台的JS验证

原创
05/13 14:22
阅读数 22904




编程客栈
jsjquery
复制代码 代码如下:

//按钮注册加载样式事件
var ItSelfButton;
var ControlRegPostResult = true;
function AddInputClick() {
$("input[type='submit']").click(function () {
ItSelfButton = $(this);
if (ItSelfButton.attr("repeat") == null) {
var btnDiv = $("<div>");
btnDiv.attr("id", "Mask_BTN");
var divimg = $("<img>");
divimg.attr("alt", "加载中...");
divimg.attr("src", "/Images/Bu编程客栈ttonLoading.gif");
divimg.css({ "margin-left": ($(this).width() - 4) / 2, "margin-top": ($(this).height() - 16) / 2 });
btnDiv.append(divimg);
btnDiv.css({ width: $(this).width() + 12 + "px", height: $(this).height() + "px", top: $(this).offset().top + "px", left: $(this).offset().left + "px", position: "absolute" });
$(document.body).append(btnDiv);
setTimeout(MaskTimeOutRemove, 200);
}
});
}
$(function () {
AddInputClick();
});
$(window).resize(fuseUAPnction () {
if (ItSelfButton != null) {
$("#Mask_BTN").css({ top: ItSelfButton.offset().top + "px", left: ItSelfButton.offset().left + "px" });
}
});
function MaskRemove() {
$("#Mask_BTN").remove();
}
function MaskTimeOutRemove() {
if (!ControlRegPostResuhttp://www.cppcns.comlt) {
$("#Mask_BTN").remove();
ControlRegPostResult = true;
}
}


复制代码 代码如下:

ControlRegPostResult = false;


http://www.cppcns.com
本文标题: asp.net表单提交时防重复提交并执行前台的JS验证
本文地址: http://www.cppcns.com/wangluo/aspnet/100720.html

发表评论

0/200
24 点赞
0 评论
收藏
为你推荐 换一批