求一数字检测的语句。谢谢 补充说明:数字为1---99间的,最多允许5个数相连 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!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>Demo </title> <script>function check(){ var reg = /^(\d{2}\+){0,4}\d{2}$/; if(!reg.test(document.all.text1.value)){ alert("格式错误"); return false; } return true;}</script></head> <body> <form action="#" method="post" onsubmit="return check()"><input type="text" name="text1"/><input type="submit" value="提交"/></form></body> </html> swfUpload怎么设置不了按钮不可用呀?急 js代码5秒后返回上一页面? 求助! 是IT人都应该看的(外包) 怎样让层不随滚动条一起动?能固定在一个位置 在当前页面里显示一个层。 层实现有javascript来实现。 iframe的问题?无法引入js谢谢 如何用Javascript改变一个对象所引用的class??? select项目的导出!! 不是关键字的方法无效 点击背景颜色变化,再点击背景还原 delObj是什么函数?
<!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>Demo </title>
<script>
function check(){
var reg = /^(\d{2}\+){0,4}\d{2}$/;
if(!reg.test(document.all.text1.value)){
alert("格式错误");
return false;
}
return true;
}
</script>
</head> <body>
<form action="#" method="post" onsubmit="return check()">
<input type="text" name="text1"/><input type="submit" value="提交"/>
</form>
</body>
</html>