JScript codevar v=document.getElementById("txtName").value;
if(v=="")
{
alert('不能为空!');
retrun false;}
else
{
return true;
}
姓名:<asp:TextBox ID="txtName" runat="server" ><asp:TextBox>怎么调用验证函数
if(v=="")
{
alert('不能为空!');
retrun false;}
else
{
return true;
}
姓名:<asp:TextBox ID="txtName" runat="server" ><asp:TextBox>怎么调用验证函数
解决方案 »
- asp.net如何实现定时页面跳转
- gridview显示 从数据库一个字段中截取的多个字符串,并实现删除,更新 功能~~好几天了。。。。
- 获取datalist里的TEXTBOX的值
- select * from GoodsInfo where pid=' 矿泉水 ' or address like ' 广州 ' 那错了?
- 树型控件问题 查找节点
- webpart功能不能用,提示SQL Server does not allow remote connections
- 晕。提交按钮没反应啊(本地一切正常)!!!!为啥?
- 关于iframe的问题!在线等侯!
- 大家帮帮忙,非常奇怪的现象~!
- 问个简单问题
- 我是初学者请帮帮忙
- MVC高手请进,求帮助!
onclientClick="return check();
function check()
{
return true;
}
{
var v=document.getElementById("txtName").value;
if(v=="")
{
alert('不能为空!');
retrun false;}
else
{
return true;
}
}
<asp:TextBox ID="txtName" runat="server" onblur=" check();" ><asp:TextBox>
<script type="text/javascript">
function chkSubmit()
{
if( 检查通过 ) return true;
else return false
}
</script><asp:Button ID="BtnSubmit" runat="server" OnClientClick="return chkSubmit();" Text="提交数据"></asp:Button>
{
var v=document.getElementById("txtName").value;
if(v=="")
{
alert('不能为空!');
retrun false;}
else
{
return true;
}
}<asp:Button ID="btNameCheck" runat="server" onclick="checkName"><asp:Button>
function a()
{
var v=document.getElementById("txtName").value;
if(v=="")
{
alert('不能为空!');
retrun false;}
else
{
return true;
}
}姓名:<asp:TextBox ID="txtName" runat="server" ><asp:TextBox>这样写:<asp:TextBox ID="txtName" runat="server" onkeyup="a()" ><asp:TextBox>
或者在提交按钮上写<asp:button id="btn" runat="server" onClientClick="a()">
小样 var v=document.getElementById("txtName").value; 它不报错!!!
找到找getElementById("txtName")这东西吗??
用这个事件onClientClick吧,是这个意思吗??
function check()
{
var v=document.getElementById("txtName").value;
if(v=="")
{
alert('不能为空!');
retrun false;}
return true;
}