oTelephone.value='032-212121';
非常简单了.
if (oTelephone.value != "") {
if (!oTelephone.value.match(/^[0-9]{3,4}\-[0-9]{7,8}$/)) {
alert('对不起,电话区号以"-"分割,且只能为数字!');
oTelephone.focus();
oTelephone.select();
return false;
}
}
时间: 2024-09-17 17:30:31