ip格式文本框
来源:互联网 发布:linux远程重启服务器 编辑:程序博客网 时间:2024/06/06 02:41
<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:30;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>IP地址输入
<div style="border-width:1;border-color:balck;border-style:solid;width:165;font-size:9pt">
<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>
</body>
<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:30;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>IP地址输入
<div style="border-width:1;border-color:balck;border-style:solid;width:165;font-size:9pt">
<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>
</body>
- ip格式文本框
- IP地址格式输入文本框
- 限制在文本框中只能输入IP地址格式
- 只能在文本框内输入IP数字格式:_._._._
- JAVASCRIPT-判断文本框格式
- 文本框控制输入时间格式
- TextBox文本框判断日期格式
- 11格式文本框RICH EDIT
- Android-输入文本框格式设置
- 文本框时间为日历格式
- html_jsp_文本框输入IP地址
- as3 里的html格式的文本框
- js限制文本框只能某种格式
- Swing_格式文本框和密码框
- Swing_格式文本框和密码框
- Swing格式文本框和密码框
- Flex 文本框的中文字符设置格式
- 编辑器原理/文本框格式控制 学习笔录
- 长期熬夜的10大严重健康后果
- QQ会员8周年活动问卷答案分享
- 通往build.XML天堂的12条路
- OLE初始化错误:往MFC中添加CLR用户控件后报错
- webbrowser控件组的小问题
- ip格式文本框
- Linux环境下的Socket编程
- 用HOOK机制让自绘菜单栏控件模拟系统菜单栏行为
- jQuery操作XML入门
- GSoap初体验[转]
- RGSSAD加密方案分析
- Hello World !
- 超酷的马踏棋盘(在DOS下运行)
- 将VK_RETURN VK_DELETE等按键消息转换为WM_CHAR消息