请分析一下下面的原因:
开始提示我对象没有定义,当我把ip1,ip2,ip3,ip4都定义后,仍然提示我“对象为空或不是对象?”为何????????????
开始提示我对象没有定义,当我把ip1,ip2,ip3,ip4都定义后,仍然提示我“对象为空或不是对象?”为何????????????
解决方案 »
- 一段JS代码的一部分这是一个仿刷票请问如何实现的
- httpwatch时 捕获不了数据
- ie限制javascript特效??
- 求助
- JSP四级联动的下拉列表(每级的列表项都从数据表中取得)
- IE 浏览器为什么不会提示错误
- 怎样在文本框的textKeyUp()事件里面把回车换成TAB?也就是当判断是回车按下的时候,取消事件然后发送一个TAB键到文本框里面.
- 合并函数 求教!!
- 如何动态控制层显示
- 兄弟们,告诉我,怎样把一个"11111"String型的js参数转换成为一个long型!
- 如果把函数的值赋值给Select下拉框的Value............在线
- 求上传图片后在主iframe得到每个图片的下拉选项函数。
windows2000Ser+IE6.0SP1可能不在这代码里面.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
.a3{width:25;border:0;text-align:center}
</style>
<script>
function mask(obj){
obj.value=obj.value.replace(/[^\d]/g,'')
key1=event.keyCode
if (key1==37 || key1==39)
{ obj.blur();
nextip=parseInt(obj.name.substr(2,1))
nextip=key1==37?nextip-1:nextip+1;
nextip=nextip>=5?1:nextip
nextip=nextip<=0?4:nextip
eval("ip"+nextip+".focus()")
}
if(obj.value.length>=3)
if(parseInt(obj.value)>=256 || parseInt(obj.value)<=0)
{
alert(parseInt(obj.value)+"IP地址错误!")
obj.value=""
obj.focus()
return false;
}
else
{ obj.blur();
nextip=parseInt(obj.name.substr(2,1))+1
nextip=nextip>=5?1:nextip
nextip=nextip<=0?4:nextip
eval("ip"+nextip+".focus()")
}
}
function mask_c(obj)
{
clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))
}</script>
<title>IP地址输入</title></head>
<body>
<form name="login" action="111.asp">
IP地址输入
<div style="border-width:1;border-color:balck;border-style:solid;width:150;font-size:8pt">
<input type=text name="ip1" maxlength=3 class=a3 onkeyup="mask(this)" onbeforepaste="mask_c()">.
<input type=text name="ip2" maxlength=3 class=a3 onkeyup="mask(this)" onbeforepaste="mask_c()">.
<input type=text name="ip3" maxlength=3 class=a3 onkeyup="mask(this)" onbeforepaste="mask_c()">.
<input type=text name="ip4" maxlength=3 class=a3 onkeyup="mask(this)" onbeforepaste="mask_c()">
</div>
</form>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
.a3{width:25;border:0;text-align:center}
</style>
<script>
function mask(obj){
obj.value=obj.value.replace(/[^\d]/g,'')
key1=event.keyCode
if (key1==37 || key1==39)
{ obj.blur();
nextip=parseInt(obj.name.substr(2,1))
nextip=key1==37?nextip-1:nextip+1;
nextip=nextip>=5?1:nextip
nextip=nextip<=0?4:nextip
eval("ip"+nextip+".focus()")
}
if(obj.value.length>=3)
if(parseInt(obj.value)>=256 || parseInt(obj.value)<=0)
{
alert(parseInt(obj.value)+"IP地址错误!")
obj.value=""
obj.focus()
return false;
}
else
{ obj.blur();
nextip=parseInt(obj.name.substr(2,1))+1
nextip=nextip>=5?1:nextip
nextip=nextip<=0?4:nextip
//原来是:eval("ip"+nextip+".focus()")改了一下,行了.
eval("document.login.ip"+nextip+".focus()")
}
}
function mask_c(obj)
{
clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))
}</script>
<title>IP地址输入</title></head>
<body>
<form name="login" action="111.asp">
IP地址输入
<div style="border-width:1;border-color:balck;border-style:solid;width:150;font-size:8pt">
<input type=text name="ip1" maxlength=3 class=a3 onkeyup="mask(this)" onbeforepaste="mask_c()">.
<input type=text name="ip2" maxlength=3 class=a3 onkeyup="mask(this)" onbeforepaste="mask_c()">.
<input type=text name="ip3" maxlength=3 class=a3 onkeyup="mask(this)" onbeforepaste="mask_c()">.
<input type=text name="ip4" maxlength=3 class=a3 onkeyup="mask(this)" onbeforepaste="mask_c()">
</div>
</form>
</body>
</html>
2.eval("document.all.ip"+nextip+".focus()")
"ip2没有定义“
或
”ip3没有定义“
或
”ip4没有定义“
<HEAD>
<TITLE>aaaa</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link href="../inc/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function mask(obj)
{
obj.value=obj.value.replace(/[^\d]/g,'')
key1=event.keyCode
if (key1==37 || key1==39)
{ obj.blur();
nextip=parseInt(obj.name.substr(2,1))
nextip=key1==37?nextip-1:nextip+1;
nextip=nextip>=5?1:nextip
nextip=nextip<=0?4:nextip
eval("ip"+nextip+".focus()")
}
if(obj.value.length>=3)
if(parseInt(obj.value)>=256 || parseInt(obj.value)<=0)
{
alert(parseInt(obj.value)+"IP地址错误!")
obj.value=""
obj.focus()
return false;
}
else
{ obj.blur();
nextip=parseInt(obj.name.substr(2,1))+1
nextip=nextip>=5?1:nextip
nextip=nextip<=0?4:nextip
eval("ip"+nextip+".focus()")
}
}
function mask_c(obj)
{
clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))
}
--->
</script>
</HEAD>
<BODY BGCOLOR=#E7E7E7 LEFTMARGIN=7 TOPMARGIN=7 RIGHTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<table width="100%" border="1" cellpadding="3" cellspacing="2" borderColorLight=#808080 borderColorDark=#ffffff>
<form name="login" method="post" action="act_config.asp?action=add_seat">
<tr bgcolor="#D1D1D1">
<td height="24" colspan="2" align="center">添加座席</td>
</tr>
<tr>
<td width="13%" align="center">IP设置</td>
<td width="87%">
<div style="border-width:1;BACKGROUND-COLOR:white;border-style:solid;width:140;height:20;">
<input type="text" name="ip1" maxlength=3 class="a3" onkeyup="mask(this)" onbeforepaste="mask_c()">.
<input type="text" name="ip2" maxlength=3 class="a3" onkeyup="mask(this)" onbeforepaste="mask_c()">.
<input type="text" name="ip3" maxlength=3 class="a3" onkeyup="mask(this)" onbeforepaste="mask_c()">.
<input type="text" name="ip4" maxlength=3 class="a3" onkeyup="mask(this)" onbeforepaste="mask_c()">
</div>
</td>
</tr>
<tr>
<td align="center">座席号</td>
<td><input name="SEATNUM" type="text" id="SEATNUM" onkeyup="device_id(this)" size="2">
【只能输入1-10】</td>
</tr>
<tr>
<td align="center">备注信息</td>
<td><textarea name="NOTES" cols="80" rows="6" id="NOTES"></textarea></td>
</tr>
<tr>
<td colspan="2" align="center"> <input type="submit" name="Submit" value="提交" class="unite">
<input type="reset" name="reset" value="重置" class="unite"></td>
</tr>
</form>
</table>
</BODY>
</HTML>
保存为ip.asp调试吧!谢谢
eval("document.login.ip"+nextip+".focus()")
IP输入两位时按向左键和向右键(“->”和“〈-”)时同样会出错,能不能这样:
按向左键跳到上一个输入框,按向右键跳到下一个输入框?拜托了,谢谢