Questions tagged [validate.js]

Questions about validate.js, a JavaScript library containing several useful functions for validating Objects.

Validate.js is currently in version 0.10.0.
It contains 3 main functions:

validate(attributes, constraints[, options])
async(attributes, constraints[, options])
single(value, constraints[, options])

All of these are very similar, but their differences are as follows:

  • validate is the basic function.
  • async starts a new thread, returning an object that resolves itself when the validation completes.
  • single evaluates a single value without the required overhead of an object literal.

See also:

23 questions
2
votes
1 answer

validate.js returns undefined when testing for single value

I am trying to validate single values by using validate.js library but I am getting udefined result from validate.single() function. var test1 = "test12345"; var test2 = "1234"; var test3 = ""; var constraints1 = { length: { is: 4 } } var…
Primoz Rome
  • 10,379
  • 17
  • 76
  • 108
1
vote
1 answer

Validate.js ReGex not working as expected

I'm attempting to use the format: pattern: functionality of Validate.js to make sure a password meets the requirements of at least one upper case, one lower case, one number, and one special character, with a minimum length of 8 and a max of 20. The…
1
vote
0 answers

Validate.js ignoring other rules

I am using the validate.js plugin to validate my form. I have a method that validates at least one of the fields are filled in by the user. I used this Answer. Here is my method: $.validator.addMethod("require_from_group", function(value, element,…
Maricris
  • 97
  • 2
  • 8
1
vote
1 answer

unobtrusive validation with custom data annotation not working

I'am stuck with some custom data validation in a .net mvc 5 project. I created custom ValidateAgeAttribute.cs with some custom data validation in it. And, I have a customvalidation.js file, where I added the method and adapter. Cannot make it…
1
vote
1 answer

Using validate.js to validate my TextInput results in undefined

I am trying to use validate.js to manage my Textfields validations and after installing validate.js and importing it as import validate from 'validate.js'; then adding it to my InputField it seems that the result is undefined. I tried to reproduce…
Ahmed Saeed
  • 635
  • 10
  • 27
1
vote
2 answers

validate.js returning error "unknown validator pattern"

I'm trying to use validate.js to validate input from the front end before entering it in the database with node but I'm getting an error that I can't figure out. I've gone over the docs and believe I setup the constraints correctly. The exact error…
user4747724
1
vote
4 answers

Error using validate.js on React Native - Unknown validator minimum

I am using validate.js from http://validatejs.org/ on react native log in screen. import React, { Component } from 'react'; import { View, Text, TextInput, TouchableOpacity } from 'react-native'; // Validate.js validates your values as…
Timothy
  • 4,198
  • 6
  • 49
  • 59
1
vote
2 answers

How to use Validate.js with Vue.js

I'm a beginner full stack developer that starting to build portal in my work. The server side will develop in asp.net mvc 5 and the client side was(HTML, CSS, SASS, JS) developed by another company and I will develop the rest of the client side for…
tal
  • 295
  • 1
  • 4
  • 20
1
vote
1 answer

Resolve all async promises with validate.js

I'm using this library for validation: https://validatejs.org/#validate-async. I've got a fairly complicated way of validating nested objects against their own schema. See the relevant code below. Basically, it will: Create an async promise for…
Richard G
  • 5,243
  • 11
  • 53
  • 95
0
votes
0 answers

ckeditor issue : need to click twice on submit button for submitting form

this is my validation code, when ckeditor is empty it's get error but when fill up ckeditor textarea have to click twice on submit button to submit form. $('#form').validate({ ignore: [], rules: { title: { …
omkar
  • 47
  • 11
0
votes
0 answers

How can I validate nested objects with validate.js

I have objects like this that I would like to validate using validate.js: let inventory={ id:'86366524-9781-4570-ab36-fba5e64d1d27', items:[ { type:'sword', power:33, amount:1 …
user2741831
  • 2,120
  • 2
  • 22
  • 43
0
votes
1 answer

validate.js validating arrays

I'm using validate.js in react to validate a form. In parts of the form, fields can be added dynamically. For example like phone numbers. How do I create validations for each of the fields that are newly created or already exist? This is as far as I…
Megaman
  • 25
  • 8
0
votes
0 answers

Ajax with validate.js returning undefined result from php

Hello All, I have written a one demo code to check weather the given input user is exist in the list or not using ajax and validate.js, when I'm running the code all functions are executing fine but insted of getting response message in succes…
SaaD Ahmed
  • 41
  • 6
0
votes
0 answers

Regex in validate.js not working as expected

I have the below rules and using validate.js but regex does not seem to work. Below is my code. Condition given : Check if string has at least one capital letter, at least one symbol and at least one number password: { presence: { …
0
votes
1 answer

NodeJS + Validate.js multiple async validators

I'm kinda new to NodeJS and I'm trying to use custom async validators for two of the fields. The reason why I'm using an async validator is that a request must be made to the database to check if a record with that id already exists. I implemented…
Veselin Bakov
  • 103
  • 1
  • 11
1
2