我在.aspx文件中写了一段验证代码:
function btnSearch_Click(oButton, oEvent){
//Add code to handle your event here.
var editor = igedit_getById("WebPanel1_WebStaMainSelect1_ctrlCorpID");
var text =editor.getValue();
if(text=="")
alert("请输入企业编号。");
}
现在的问题是提示信息后,页面还会继续刷新一次,怎样才能在提示信息后不在提交页面呢?
function btnSearch_Click(oButton, oEvent){
//Add code to handle your event here.
var editor = igedit_getById("WebPanel1_WebStaMainSelect1_ctrlCorpID");
var text =editor.getValue();
if(text=="")
alert("请输入企业编号。");
}
现在的问题是提示信息后,页面还会继续刷新一次,怎样才能在提示信息后不在提交页面呢?
解决方案 »
- formview中的pagertemplet,为什么没有显示?
- 求正则,关键词内链!
- 初学者请教!!!怎么为GridView创建EditCommand,UpdateCommand,CancelCommand事件处理程序?
- 请问“文件上传”怎么做?
- Asp.Net窗体验证可以在服务器端强制别人的移除身份验证票吗?
- 紧急求救!asp.net 2003和2002的移植问题
- 高手--------------进
- 这样的正则表达式您见过没? 太复杂了。。。
- 如何做到点击 button1 后能把多个被 checkbox 选中的项的id号存入表中?
- 如何通过url传递一个中文变量?
- RSS 怎么做的?
- 十万火急!.net1.1中web.config的问题!
//Add code to handle your event here.
var editor = igedit_getById("WebPanel1_WebStaMainSelect1_ctrlCorpID");
var text =editor.getValue();
if(text==""){
alert("请输入企业编号。");return false ;
}
return true ;}然后 <form onsubmit="return btnSearch_Click('','')"
在Form中写入代码没用。我是用用户控件把一些输入框和按钮放在一起的,而代码是在引用它的页面中的。用户控件中又没有Form?