必须包含http可以用str.indexOf('http')!=-1
包含正整数可以用正则/\d+/.test(str)
包含正整数可以用正则/\d+/.test(str)
解决方案 »
- ExtJS4.2和ExtJS3.0的兼容
- 看到有人用jquery把radio单选框的原型变成方的?
- 为什么不能通过element.style.left获得元素坐标
- 给select加横滚动条
- HTML带参数问题,不知甚解。。。。。。
- 关于jquery的mousewheel事件
- 总在这一行:document.form1.submit();说对象不支持属性或方法,怎么办呀!
- 请孟板主看过来:服务端保存别的网站内容问题
- 我怎样使新打开的窗口位于屏幕的中间?
- 用php和js怎么把订单数据传送到后台呢,还有第二页还可以修改数量
- MediaPlayer如何实现跳转指定的播放时间
- html怎样获取URL传过来的值?
alert(" 请选择 \"区域\" ,。");
theForm.city.focus();
return false;
}else if (~theForm.a1.value.indexOf("http")){
alert(" a1里面的字符必须包含http");
theForm.a1.focus();
return false;
}else if (/^0$|^[1-9]\d*$/.test(theForm.a2.value)){
alert("a2里面的必须为正整数或者0");
theForm.a2.focus();
return false;
}
注:不推荐theForm.a1.value这种不规范写法。
}else if (!~theForm.a1.value.indexOf("http")){