<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 16px; WIDTH: 648px; POSITION: absolute; TOP: 24px; HEIGHT: 72px"
borderColor="black" cellSpacing="1" cellPadding="1" width="648" border="0">
<TR>
<TD style="WIDTH: 89px; HEIGHT: 28px"><FONT face="宋体"><asp:label id="labBH" runat="server">信息编号</asp:label></FONT></TD>
<TD style="WIDTH: 200px; HEIGHT: 28px"><FONT face="宋体"><asp:textbox id="TBBH" runat="server" Width="104px" ></asp:textbox></FONT></TD>
<TD style="WIDTH: 103px; HEIGHT: 28px"><asp:label id="LabGXRI" runat="server">更新日期</asp:label></TD>
<TD style="HEIGHT: 29px"><FONT face="宋体" id="FONT1">
<asp:textbox id="TbTIME" runat="server" Width="104px"></asp:textbox> </FONT></TD>
</TR>
<TR>
<TD style="height: 30px"><asp:button id="ButTJ" runat="server" Text="提交" onclick="ButTJ_Click" ></asp:button></TD>
<TD style="height: 30px"><asp:button id="ButCZ" runat="server" Text="重置" onclick="ButCZ_Click"></asp:button></TD>
</TR>
</TABLE>
<br />
</form>
<script type="text/javascript" language="javascript">
function check()
{
if(Form1.TBBH.value=="")
{
alert("请输信息编号")
Form1.TBBH.focus();
return false;
}
}
</script>
</body>
</HTML>
这个验证不起作用??应该怎么写啊?
解决方案 »
- 关于HOOK函数的代码,麻烦看下哪里出的问题
- 窗体里添加DataGridView,绑定数据,运行后修改里面的内容(多表连接查询)
- 如何在VS2005下面添加字段
- 查询的时候如何在SQL语句中顺便给查询结果表起个名字,当作查询结果表的临时表名。
- 求URL 输入格式的检查代码
- 谁能所说groupBox和panel的差别?
- 类型化的DataSet里的自动编号,与数据源的自动编号不一致,
- 用VS打包安装程序,怎么不能把framework打入阿??
- 关于xml问题!(高手请进)
- .net 害人阿! 各位到底有没有作成嵌入.net framework等环境的setup
- 变量生命周期
- 在vs2008里边有没有像打开“我的电脑”左边那种可以收放的菜单控件啊?
在你需要的地方调用Check方法啊
<form id="Form1" method="post" runat="server" onsubmit="return check();">
<input runat="server" type="submit" name="Submit" value="提交" id="Submit1" />
你这段onclick="ButTJ_Click",ButTJ_Click这个应该在后台代码里实现,然后你对于空的验证放在前台来执行是对的,但是你是不知道用什么事件,OnClientClick = "return check()",这样就是先触发OnClientClick事件,再触发onclick事件