<input type=text name=myipu onkeydown="test(event.keyCode)">
<SCRIPT LANGUAGE=javascript>
<!--
function test(key){
if ( document.all.myipu.value != "" )
return;
if ( key == 48 ){
document.all.myipu.maxLength = 12
}
else{
document.all.myipu.maxLength = 11
}
}
function CheckLT(ipt) { //检查是否为合法的手机号码,用于提交是检测
var filter=/^13[0-9]{1}[0-9]{8}$/;
if (!filter.test(ipt))
{
alert("不合法");
}
else
{
alert("合法");
}
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript>
<!--
function test(key){
if ( document.all.myipu.value != "" )
return;
if ( key == 48 ){
document.all.myipu.maxLength = 12
}
else{
document.all.myipu.maxLength = 11
}
}
function CheckLT(ipt) { //检查是否为合法的手机号码,用于提交是检测
var filter=/^13[0-9]{1}[0-9]{8}$/;
if (!filter.test(ipt))
{
alert("不合法");
}
else
{
alert("合法");
}
}
//-->
</SCRIPT>
<script language="javascript">
<!--
function ck(o)
{
if( /^(010|020|13)/.test(o.value) )
o.maxLength = 11;
else
{
o.maxLength = 12;
}
}
//-->
</script>