当前位置:网站首页>Form verification of landline
Form verification of landline
2022-07-29 03:40:00 【Brave cow, rush】
landlineValidatorFn (value) {
// Verify the landline number The longest 15 position , Allow input of "-"
let validText = new Text().verify(value);
if (validText) {
return validText;
}
if (value.length >= 15) {
return _(' The maximum allowable landline number 15 position ');
}
if (value.includes(' ')) {
return _(' No blank space is allowed for landline ');
}
if (value.length === 1) {
let tmp = value;
if (isNaN(parseInt(tmp, 10))) {
if (!(value === '-')) {
return _(' Please enter a number or -');
}
}
} else {
let arr = value.split('');
let res = arr.every(function (item) {
//every One false is false
if (isNaN(parseInt(item, 10))) {
if (item === '-') {
return true;
}
return false;
}
return true;
});
if (!res) {
return _(' Please enter a number or -');
}
}
return true;
},
边栏推荐
- 《陌路曾相逢》夏陌沈疏晏_夏陌沈疏晏最新章节
- RTP send and receive h265
- Tencent cloud logs in with PEM
- Anaconda offline installation environment
- Why don't programmers work blindly?
- (nowcoder22529c) diner (inclusion exclusion principle + permutation and combination)
- Why do programmers so "dislike" the trunk development mode?
- 腾讯云使用pem登录
- Why BGP server is used in sunflower remote control? Automatic optimal route and high-speed transmission across operators
- xxxxx
猜你喜欢

RHCE的at,crontab的基本操作,chrony服务和对称加密和非对称加密

CUDA GDB prompt: /tmp/tmpxft**** cudafe1.stub. c: No such file or directory.

Bingbing learning notes: operator overloading -- implementation of date class

Rdkit II: use rdkit screening to screen 2D pharmacophores of chemical small molecules

Raft protocol - process demonstration

Various minor problems of jupyter notebook, configuration environment, code completion, remote connection, etc

for_each用法示例

数字孪生实际应用案例-智慧能源篇

Sunflower senior product director technology sharing: "how to apply national remote control" in AD domain environment

Deep into C language (3) -- input and output stream of C
随机推荐
Why do programmers so "dislike" the trunk development mode?
安装抓包证书
Process tracking of ribbon principle
Casbin入门
代码 ~ 隐藏或禁用状态栏和虚拟按键
【redis系列】字符串数据结构
"The programming is not standardized, and my colleagues are in tears!"
Ribbon principle analysis namedcontextfactory
(2022 Hangdian multi school III) 1002 boss rush (pressure dp+ dichotomy)
Sleuth+Zipkin 来进行分布式服务链路的追踪
Asynchronous callback future mode of concurrent mode
Introduction to static routing and dynamic routing protocols OSPF and rip and static routing configuration commands
Understanding of p-type problems, NP problems, NPC problems, and NP hard problems in natural computing
Tristate gate
1. Header file - Comment - namespace - standard input / output stream
lodash库常用方法
Introduction to JVM foundation I (memory structure)
How do programmers use code to completely end those things in the system?
1.6 example: cifar-10 classification
RTP 发送 和接收 h265