你这个pF_Verify()方法没有带参数?而你这里return pF_Verify('txtName')是带参数的挖在JS那个方法里加上参数
解决方案 »
- 停止调试asp.net后怎么不关闭Development Sever
- 新手求助!在线急等!
- 鼠标移到上面,横着淡出内容
- Visual Studio 2005不能新建asp.net项目??急!!
- 如何设置webconfig中的 authentication ?
- 关于RTX不能实例化RTXClient.RTXAPIClass的问题请教
- html里面 <!--include file="XXX"-->显示不正确,什么原因?
- 为什么在vs2005+sql2000开发的Flash投票调查上传到服务器后则无法更新投票数和返回结果?
- 我想得到一个图片文件的宽和高.怎么做.下面的代码出错,说未将对象引用到实例.
- 有关B/S打印的千古难题!
- 解决此问题,有100分,不够再加
- 哪位能给我讲一下有些类实例化和不需要实例化的区别
你传的是字符串
document.all(a[0]).Value == "")
看看生成的是什么东西
function pF_Verify()
{
var a= document.all.<%= txtName.ClientID %>.value;
if (a == "")
{
alert("请输入姓名");
return false;
}
else
{
return true;
}
}
cmdSave.Attributes.Add ("onclick","return pF_Verify()");
这样试试
{
Button2.Attributes.Add("onclick","ClickButton2('TextBox1')");
}----------------------
script: function ClickButton2(c)
{
var txt = document.getElementById(c);
var s = (eval(txt)).value;
alert(s);
if(s =="ok")
{
alert("ok");
}
else
{
return false;
}
}
{
//if (!Page.IsPostBack)
//{
cmdSave.Attributes.Add ("onclick","return pF_Verify('txtName')");
//}
}function pF_Verify(a)
{
aa=eval('document.表单名.' + a + '.Value');
if (aa== ""))
{
alert("请输入姓名");
return false;
}
else
{
return true;
}
}
在运行时有问题,提示我没有对象(pF_Verify).
<TABLE id="tab1" style="Z-INDEX: 103; LEFT: 208px; WIDTH: 370px; POSITION: absolute; TOP: 16px; HEIGHT: 44px" cellSpacing="0" cellPadding="0" width="370" border="0">
<TR>
<TD style="WIDTH: 80px"><input type="image" name="cmdAdd" id="cmdAdd" src="img/add.gif" border="0" style="height:20px;width:72px;" /></TD>
<TD><input type="image" name="cmdUpdate" id="cmdUpdate" src="img/Update.gif" border="0" style="height:20px;width:72px;" /></TD>
<TD><input type="image" name="cmdDelete" id="cmdDelete" src="img/delete.gif" border="0" style="height:20px;width:72px;" /></TD>
<TD><input type="image" name="cmdCancel" id="cmdCancel" src="img/Cancel.gif" border="0" style="height:20px;width:72px;" /></TD>
<TD><input type="image" name="cmdSave" id="cmdSave" onclick="return pF_Verify()" src="img/Save.gif" border="0" style="height:20px;width:72px;" /></TD>
</TR>
</TABLE>
以上是运行时生成的Html中片段
最后一个<TD>那找不到pF_Verify
用你的能搞定,你能告诉我之前我的方法是不是触发不了pF_Verify?