-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs
93 lines (62 loc) · 3.47 KB
/
docs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Validator JS Developer Guide
About
Validator js is a javascript + jquery library developed for form validation.It is a super easy library to use with number of different validation rules.
Why use validator js?
1 - It is a super easy library to implement,which can be embeded directly into your html tags code just like the default html 5 validation.
You heard it right,no javascript code required for basic validation.
2 - Ever wanted a validation which cannot be altered?
If yes,then this is the perfect library for your need.Rules and validation once applied using validator js cannot be manipulated using the dom.
3 - Number of different validation rules which will help you accomplish your client side validation with just one line.
Requirements -
- JQuery
Set of validation rules available -
required - specify if a field is required
syntax - rules="required"
alpha - check if a input is a valid alpha.Can contain only characters.No numbers or special characters
syntax - rules="alpha"
alphanumeric - check if a input is alpha-numeric.Can contain characters and numbers.No special characters
syntax - rules="alphanumeric"
number - validate a digit.No special characters,only allows dot.
syntax - rules="number"
email - validate if the input is a valid email
syntax - rules="email"
url - validate if the input is a valid url
syntax - rules="url"
min - set minimum value for a input
syntax - rules="min[int|function_name|field_name]"
max - set maximum value for a input
syntax - rules="max[int|function_name|field_name]"
min_length - set minimum length for a input
syntax - rules="min_length[int|function_name|field_name]"
max_length - set maximum length for a input
syntax - rules="max_length[int|function_name|field_name]"
same - validate if the value is same as the field specified.Returns true if value matches
syntax - rules="same[name_of_field_check]"
notequal - validate if the value is same as the field specified.Return false if value is the same
syntax - rules="notequal[name_of_field_check]"
requiredif - set the field as required if a certain field is filled
syntax - rules="requiredif[name_of_field_check]"
notrequiredif - set if the field is not required based on a certain field
syntax - rules="notrequiredif[name_of_field_check]"
date - validate if the input is a valid date
syntax - rules="date[format]"
formats - ymd , mdy , dmy
visa - validate if the input contains a valid visa card number
syntax - rules="visa"
mastercard - validate if the input contains a valid master card number
syntax - rules="mastercard"
americanexp - validate if the input contains a valid american express card number
syntax - rules="americanexp"
aadhar_card - validate if the input is a valid aadhar card number
syntax - rules="aadhar_card"
pan_card - validate if the input is a valid pan card number
syntax - rules="pan_card"
time - validate if the input is a valid time format
syntax - rules="time[format]"
formats - H:m:s , h:m:s , H:m , h:m
username - validates if the input is a valid username.Username must contain atleast 2 characters,can contain numbers and some special characters (which are globally used in usernames like underscore).
syntax - rules="username"
mobile - validate if a given input is a mobile number
syntax - rules="mobile|mobile[max]|mobile[min,max]"
password - checks if the password is a strong password.Checks for uppercase,lowercase,number and special characters in the input.
syntax - rules="password|password[no_of_lower_case,no_of_upper_case,no_of_integers,no_of_special_characters]"