async-validator icon indicating copy to clipboard operation
async-validator copied to clipboard

validate form asynchronous

Results 129 async-validator issues
Sort by recently updated
recently updated
newest added

你好,下面是代码: discount: [ { required: false, type: "number", message: "请在折扣金额文字框中输入正确的数字格式", trigger: 'blur', transform(value) { return parseFloat(value); }, } ], 改成v-model.number 之后,只能输入整数,而且blur之后,空着也不行,还必须录入内容,type为float时,只能输入5.33这样的数字,不带小数点不行,小数点后面为0也不行 这个怎么解决,感谢

When a validator function return "un-strict" boolean value(like `0`, `1`), the result promise will be pending forever. This issue make me stuck for hours. I think it will help people...

```js import Validator from 'async-validator' // 版本:"async-validator": "^3.5.2" const desc= { inputName: { type: "url" }, val: [ { validator: (rule, value, callback) => { if(value) { if(value === '111')...

下面是我rules,可是失去焦点的时候不起作用,请问怎么书写 ```js rules: { email: [ { pattern: /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, message: 'Opps! something went wrong here', trigger: 'blur', }, ], }, ```

自定义验证方法validator中的参数value取到的最是旧的值,修改之前的值。 HTML: ```html ``` ```javascript ules: [ { validator(rule, value, callback, source, options) { console.log(value); // 此处拿到的值总是修改之前的 }, trigger: 'change' } ] ``` 例如像上面代码有两上复选框,先选择AAA,然后选择BBB, 控制台上会先输出空数组,然后是['AAA']

我想引入最新版async-validator 但是项目中的第三方ui框架正在使用```async-validator@^1.12.2``` 两者是否能共存互不影响?

### 当表单的字段有多种类型时,抛出错误: Error: Unknown rule type object,string ### 声明的难规则如下: rules="{'type':['object', 'string']}" #### 问题代码: getType: function getType(rule) { if (rule.type === undefined && rule.pattern instanceof RegExp) { rule.type = 'pattern'; }...

``` { required: true, message: 'error from message', validator(rule, value, callback) { callback('error from validator') } } ``` 这种时候,页面上显示的错误信息,应该以 validator 的输出为准,而不是输出 message的值。但其实控制台的报错信息是 validator的值,这就很矛盾了

能否支持 一开始 ```javascript rules:{ } ``` 不配置,后面 给 ```javascript rules : { mobile : [{}, {}] } ``` 赋值,动态添加规则的效果?

The regex used for URL validation shows quadratic behavior with unusual, but not necessarily pathological, inputs: ```js let re = new RegExp( '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$', 'i', ) let maybeUrl = "https://" for...