当前位置:网站首页>[verification] only numbers (positive and negative numbers) can be entered
[verification] only numbers (positive and negative numbers) can be entered
2022-07-24 18:11:00 【Solution without encirclement】
var validate = (rule, val, callback) => {
if (!val) {
callback(new Error(' Please enter '))
} else {
const reg = /^[+-]?(0|([1-9]\d*))(\.\d+)?$/
if (reg.test(val)) {
return callback()
} else {
callback(new Error(' Input format error '))
}
}
}Enter positive and negative numbers
边栏推荐
- 如何为超级通胀做好准备
- After separation, the impression notes are still difficult to live, but there are many coquettish operations
- mac数据库管理软件Navicat Premium Essentials Mac
- 0625~<config>-<bus>
- 0616 end of Project II ~ ~ general summary
- Has polardb for PostgreSQL entered the list of Xinchuang database?
- Shanghai Jiaotong University team used joint deep learning to optimize metabonomics research
- 获取1688app上原数据 API
- Use of jumpserver
- es(1)
猜你喜欢

Shengxin commonly used analysis graphics drawing 02 -- unlock the essence of volcano map!

Section 7 Data Dictionary: hash followed by Daewoo redis ------- directory post

C language to achieve a static version of the address book

深入解析著名的阿里云Log4j 漏洞

关于接口的写法 1链式判读 ?. 2方法执行 (finally)一定会执行

Interview assault 66: what is the difference between request forwarding and request redirection?

Icml2022 Best Paper Award: learning protein reverse folding from millions of predicted structures

Common methods of number and math classes

The ability to detect movement in vivo and build a safe and reliable payment level "face brushing" experience

Use of jumpserver
随机推荐
Learn redisson from scratch ------- topics (subscription and distribution)
头文件是必须的吗?跟一跟编译过程~~~
Baidu touch.js
Mozilla foundation released 2022 Internet health report: AI will contribute 15.7 trillion yuan to the global economy in 2030, and the investment in AI in the United States last year was nearly three t
steam API
0615 ~ realize RBAC permission management with user-defined annotations
0612~quartz定时器框架
IO multiplexing
数组常用方法(2)
Example of single table query in ORM student management system
还在从零开始搭建项目?这款升级版快速开发脚手架值得一试!
2022最新短视频去水印解析API接口分享
How does win11 enhance the microphone? Win11 enhanced microphone settings
【校验】只能输入数字(正负数)
int8 & int8,你栽过这样的跟头吗?
Win10 super good-looking mouse theme, you also try it
关于接口的写法 1链式判读 ?. 2方法执行 (finally)一定会执行
0630~ professional quality course
The use and Simulation of character and string library functions in C language
New can also create objects. Why do you need factory mode?