当前位置:网站首页>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;
},
边栏推荐
- Use of leak scanning (vulnerability scanning) tool burpsuite or burp Suite (with installation and installation package download of burpsuite+1.7.26)
- HDU multi School Game 2 1011 DOS card
- Deep understanding of Base64 underlying principles
- Kotlin companion object vs global function
- HDU多校第二场 1011 DOS Card
- Environment configuration stepping pit during colab use
- Mathematical modeling -- analytic hierarchy process model
- 2. Variables and scope
- RTP 发送 和接收 h265
- Leetcode 1331 array sequence number conversion [map] the leetcode path of heroding
猜你喜欢

Whole process record of yolov3 target detection

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

Deep into C language (3) -- input and output stream of C

Asynchronous callback future mode of concurrent mode

(codeforce547) c-mike and foam

Raft protocol - process demonstration

Mathematical modeling -- analytic hierarchy process model

Shutter start white screen

Idea configuration web container and war packaging

Simple code implementation of decision tree
随机推荐
MOS tube - rapid recovery application notes (II) [parameters and applications]
Cannot paste multiple pictures at once
04 | background login: login method based on account and password (Part 1)
ROS - create workspace
Shortcut key for adjusting terminal size in ROS
(nowcoder22529c) diner (inclusion exclusion principle + permutation and combination)
容斥原理
Rdkit: introduce smiles code, smart code and Morgan fingerprint (ECFP)
通过递归实现多级联动
1.5 nn. Module neural network (III)
Learn exkmp again (exkmp template)
向日葵远程控制为何采用BGP服务器?自动最优路线、跨运营商高速传输
SFTP upload error: com.jcraft.jsch JSchException: connection is closed by foreign host
Rdkit I: using rdkit to screen the structural characteristics of chemical small molecules
1. Header file - Comment - namespace - standard input / output stream
RHCE的at,crontab的基本操作,chrony服务和对称加密和非对称加密
Environment configuration stepping pit during colab use
How do programmers use code to completely end those things in the system?
AI_ Drug: VAE of molecular generation model (I)
Microcomputer principle operation