当前位置:网站首页>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;
},
边栏推荐
- Easy to use remote sensing data set download website~~~
- Shortcut key for adjusting terminal size in ROS
- Getting started with caspin
- ROS-Errror:Did you forget to specify generate_ messages(DEPENDENCIES ...)?
- Li Kou daily question - day 44 -205. Isomorphic string
- Cloudera manager platform fault repair record
- Singleton and invariant modes of concurrent mode
- i. MX 8m plus integrated dedicated neural processing engine (NPU)
- Raft protocol - process demonstration
- Leetcode 1331 array sequence number conversion [map] the leetcode path of heroding
猜你喜欢

for_ Example of each usage

KNN method predicts pregnancy, KNN principle simple code

Simple code implementation of decision tree

How to understand clock cycle and formula CPU execution time = number of CPU clock cycles / dominant frequency

Exness: dove resolution helped gold rebound, and the focus turned to U.S. GDP

Instance setup flask service (simple version)

Why is continuous integration and deployment important in development?

Shutter start white screen

容斥原理

I.MX6U-驱动开发-2-LED驱动
随机推荐
Install the packet capturing certificate
Raft protocol - process demonstration
Understanding of p-type problems, NP problems, NPC problems, and NP hard problems in natural computing
腾讯云使用pem登录
容斥原理
Excel拼接数据库语句
How to understand clock cycle and formula CPU execution time = number of CPU clock cycles / dominant frequency
Leetcode 1331 array sequence number conversion [map] the leetcode path of heroding
Complexity analysis learning
for_ Example of each usage
Exness: dove resolution helped gold rebound, and the focus turned to U.S. GDP
1. Header file - Comment - namespace - standard input / output stream
Li Kou daily question - day 44 -205. Isomorphic string
(newcoder 15079) irrelevant (inclusion exclusion principle)
KNN method predicts pregnancy, KNN principle simple code
(newcoder 15079)无关(容斥原理)
Why BGP server is used in sunflower remote control? Automatic optimal route and high-speed transmission across operators
实例搭建Flask服务(简易版)
Simple use of eventbus
Connect with third-party QQ login