.net js验证为空j时,不让button执行onclick事件
来源:互联网 发布:知其白守其黑的哲理 编辑:程序博客网 时间:2024/06/01 08:52
<script type ="text/javascript" language="javascript">
function checkInput() {
var strMsg = "";
var userName = document.getElementById("<%=txt_Uer.ClientID%>").value;
var password = document.getElementById("<%=txt_Password.ClientID%>").value;
var txt_key = document.getElementById("<%=txt_key.ClientID%>").value;
if (userName == "" || userName == null) {
strMsg = "用户名"
}
if (password == "" || password == null) {
strMsg += " 密码"
}
if (txt_key == "" || txt_key == null) {
strMsg += " 验证码"
}
if (strMsg != "") {
alert(strMsg + " 不能为空!");
return false;
}
}
</script>
<asp:Button ID="Button1" runat="server" Text="登录" onclick="Button1_Click" OnClientClick="return checkInput()" />
- .net js验证为空j时,不让button执行onclick事件
- ASP.NET执行 Button控件 OnClick事件之前进行 JS验证 通过之后执行服务器事件 不通过不执行
- js触发asp.net的Button的Onclick事件
- asp.net button onclick 按刷新会重复执行onclick事件
- asp.net中Button按钮点击两次才执行Onclick事件的原因
- 客户端验证和onclick事件句柄,前台js验证和.net控件验证
- 使用js为button添加回车执行事件
- js验证为空
- 控制不让为空
- 服务器控件button点击时执行脚本弹出提示对话框Button2.Attributes.Add("onclick","事件")
- Button 控件的 OnClientClick 和 OnClick 事件执行顺序问题
- button的onclick事件
- js 输入框为空时 disable button
- 新增button控件为其添加onClick事件及Text
- 关于asp.net button按钮的OnClick和OnClientClick事件
- asp.net button的OnClick和OnClientClick事件
- asp.net button的OnClick和OnClientClick事件
- asp.net button的OnClick和OnClientClick事件 .
- lnmp (linux+nginx+mysql+php) 环境安装脚本
- Python迭代和生成器三篇好文章
- 解决微软雅黑在word中行距过宽问题
- Surface名字背后的故事:世界最贵咖啡桌已经改名Pixelsense
- c# BackGroundWorker 多线程操作的小例子
- .net js验证为空j时,不让button执行onclick事件
- C语言 全局变量和局部变量的大小限制(关于堆栈的划定)
- 网站
- Android实现豆瓣FM的首页效果
- VC6 对UNICODE的支持
- 随笔九:操作系统的几个基本抽象
- JS 计算外出办事时间(按照一天工作八小时制)
- centos下用mytop监控mysql
- 数据结构- 串的模式匹配算法:BF和 KMP算法