怎么focusto函数无法定位啊?

zhf777 2002-11-26 04:54:05
我用的是WIN2000的操作系统,装了IIS5.0和.NET FRAMEWORK
判断语句可以判断出哪些空格没填,但focusto却无法定位,不管哪个空都定位到浏览器的URL地址拦,这是怎么回事呢

if InStr(reg.email.value,"@") = 0 Then
focusto(4)
alert "Email未填或缺少@符号!"
exit function
end if
……
function focusto(x)
document.form.elements(x).focus()
end function
...全文
91 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhf777 2002-11-26
  • 打赏
  • 举报
回复
谢谢了~~~~~~~~~~~
zhigangxie 2002-11-26
  • 打赏
  • 举报
回复
判断邮件格式的JS函数:
//====================================================
// note:
// these valid email address will not acceptable
// "J. P. 's-Gravezande, a.k.a. The Hacker!"@server.com
// me@[187.223.45.119]
//
// zhigang xie, 2002/10/31
//====================================================
function checkEmail(strAdd){
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var pass = filter.test(strAdd);

if(pass) return true;
var msg = 'Incorrect email address';
if(arguments.length>=2)msg = arguments[1];
alert(msg);
return false;
}

定位到触发事件的对象上去:
try{
event.srcElement.focus();
}
catch(e){
//
}

或者通过名称(ID)定位:
try{
document.getElementByID(strElementID).focus();
}
catch(e){
//
}
LoneHome 2002-11-26
  • 打赏
  • 举报
回复
if InStr(reg.email.value,"@") = 0 Then
alert "Email未填或缺少@符号!"
focusto(4)
exit function
end if
……
function focusto(x)
document.form.elements(x).focus()
end function

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧