<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title></head><body>
<script type="text/javascript">
//校验IP地址格式
function test()
{
//alert("haha");
window.alert(document.form3.ipaddress.value);
}function checkip()
{
var scount=0;
var ip = document.form3.ipaddress.value;
var iplength = ip.length;
var Letters = "1234567890.";
//window.alert(iplength);
//window.alert(document.form3.ipaddress.value);
//window.alert(CheckChar);
for (i=0; i < document.form3.ipaddress.value.length; i++)
{
var CheckChar = document.form3.ipaddress.value.charAt(i);
window.alert(CheckChar);
if (Letters.indexOf(CheckChar) == -1)
{
alert ("IP地址格式不对!!,只能输入数字和“.”,格式为XXX.XXX.XXX.XXX 例如:192.168.0.1");
document.form3.ipaddress.value="";
document.form3.ipaddress.focus();
return false;
}
}
}
</script><table width="97%" height="120%" valign="top">
<tr>
<td width="45%" height="100%" valign="top">
<fieldset>
<legend>IP配置</legend>
<p>
<fieldset>
<legend>IP设置方式</legend>
<form id="form1" name="form1" method="post" action="">
<p>
<label>
<input type="radio" name="RadioGroup1" value="单选" />
固定IP</label>
<br />
<label>
<input type="radio" name="RadioGroup1" value="单选" />
PPPOE连接</label>
<br />
</p>
</form>
</fieldset>
<fieldset>
<legend>PPPOE</legend>
<form id="form2" name="form2" method="post" action="">
<table width="100%">
<tr>
<td width="23%"><div align="right">用户名</div></td>
<td width="77%"><input type="text" name="textfield" /></td>
</tr>
<tr>
<td><div align="right">密码</div></td>
<td><input type="text" name="textfield2" /></td>
</tr>
</table>
</form>
</fieldset>
<fieldset>
<legend>IP地址</legend>
<form id="form3" name="form3" method="post" action="">
<table width="100%">
<tr>
<td width="37%"><div align="right">IP地址</div></td>
<td width="63%"><input type="text" name="ipaddress" id="ipaddress" onblur="checkip()" /></td>
</tr>
<tr>
<td><div align="right">子网掩码</div></td>
<td><input type="text" name="mask" /></td>
</tr>
<tr>
<td><div align="right">网关</div></td>
<td><input type="text" name="gate" /></td>
</tr>
<tr>
<td><div align="right">域名服务器一</div></td>
<td><input type="text" name="dns1" /></td>
</tr>
<tr>
<td><div align="right">域名服务器二</div></td>
<td><input type="text" name="dns2" /></td>
</tr>
</table>
</form>
</fieldset>
</p>
<input type="submit" name="Submit" value="提交" onclick="checkip()"/>
</fieldset>
</td>
<td width="45%" valign="top">
<p>
<fieldset>
<legend>连接控制中心</legend>
<p>
<fieldset>
<legend>控制中心IP设置</legend>
<form id="form4" name="form4" method="post" action="">
<table width="100%">
<tr>
<td width="37%"><div align="right">控制中心IP地址</div></td>
<td width="63%"><input type="text" name="textfield4" /></td>
</tr>
<tr>
<td><div align="right">控制中心端口</div></td>
<td><input type="text" name="textfield42" /></td>
</tr>
</table>
</form>
<form id="form5" name="form5" method="post" action="">
</form>
</fieldset>
</p>
<form id="form6" name="form6" method="post" action="">
<input type="submit" name="Submit3" value="连接测试" />
</form>
<p>
<input type="submit" name="Submit2" value="提交" />
</p>
</fieldset>
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table>
</body></html>onblur里面的老
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title></head><body>
<script type="text/javascript">
//校验IP地址格式
function test()
{
//alert("haha");
window.alert(document.form3.ipaddress.value);
}function checkip()
{
var scount=0;
var ip = document.form3.ipaddress.value;
var iplength = ip.length;
var Letters = "1234567890.";
//window.alert(iplength);
//window.alert(document.form3.ipaddress.value);
//window.alert(CheckChar);
for (i=0; i < document.form3.ipaddress.value.length; i++)
{
var CheckChar = document.form3.ipaddress.value.charAt(i);
window.alert(CheckChar);
if (Letters.indexOf(CheckChar) == -1)
{
alert ("IP地址格式不对!!,只能输入数字和“.”,格式为XXX.XXX.XXX.XXX 例如:192.168.0.1");
document.form3.ipaddress.value="";
document.form3.ipaddress.focus();
return false;
}
}
}
</script><table width="97%" height="120%" valign="top">
<tr>
<td width="45%" height="100%" valign="top">
<fieldset>
<legend>IP配置</legend>
<p>
<fieldset>
<legend>IP设置方式</legend>
<form id="form1" name="form1" method="post" action="">
<p>
<label>
<input type="radio" name="RadioGroup1" value="单选" />
固定IP</label>
<br />
<label>
<input type="radio" name="RadioGroup1" value="单选" />
PPPOE连接</label>
<br />
</p>
</form>
</fieldset>
<fieldset>
<legend>PPPOE</legend>
<form id="form2" name="form2" method="post" action="">
<table width="100%">
<tr>
<td width="23%"><div align="right">用户名</div></td>
<td width="77%"><input type="text" name="textfield" /></td>
</tr>
<tr>
<td><div align="right">密码</div></td>
<td><input type="text" name="textfield2" /></td>
</tr>
</table>
</form>
</fieldset>
<fieldset>
<legend>IP地址</legend>
<form id="form3" name="form3" method="post" action="">
<table width="100%">
<tr>
<td width="37%"><div align="right">IP地址</div></td>
<td width="63%"><input type="text" name="ipaddress" id="ipaddress" onblur="checkip()" /></td>
</tr>
<tr>
<td><div align="right">子网掩码</div></td>
<td><input type="text" name="mask" /></td>
</tr>
<tr>
<td><div align="right">网关</div></td>
<td><input type="text" name="gate" /></td>
</tr>
<tr>
<td><div align="right">域名服务器一</div></td>
<td><input type="text" name="dns1" /></td>
</tr>
<tr>
<td><div align="right">域名服务器二</div></td>
<td><input type="text" name="dns2" /></td>
</tr>
</table>
</form>
</fieldset>
</p>
<input type="submit" name="Submit" value="提交" onclick="checkip()"/>
</fieldset>
</td>
<td width="45%" valign="top">
<p>
<fieldset>
<legend>连接控制中心</legend>
<p>
<fieldset>
<legend>控制中心IP设置</legend>
<form id="form4" name="form4" method="post" action="">
<table width="100%">
<tr>
<td width="37%"><div align="right">控制中心IP地址</div></td>
<td width="63%"><input type="text" name="textfield4" /></td>
</tr>
<tr>
<td><div align="right">控制中心端口</div></td>
<td><input type="text" name="textfield42" /></td>
</tr>
</table>
</form>
<form id="form5" name="form5" method="post" action="">
</form>
</fieldset>
</p>
<form id="form6" name="form6" method="post" action="">
<input type="submit" name="Submit3" value="连接测试" />
</form>
<p>
<input type="submit" name="Submit2" value="提交" />
</p>
</fieldset>
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table>
</body></html>onblur里面的老
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货