Skip to content

Commit 1f7adc8

Browse files
Update README.md
1 parent d89576d commit 1f7adc8

1 file changed

Lines changed: 28 additions & 29 deletions

File tree

README.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@
1919
**Steps to Integrate to Form :**
2020

2121
```html
22-
<script src="./../src/js/formValidator.js"></script>
22+
<script src="./../src/js/formValidator.js"></script>
2323
```
2424

2525
Then Integrate your form with Validator.
2626

2727
2828
```javascript
29-
var myform = new jsValidator().init({
29+
var myform = new jsValidator().init({
3030
form: 'form2submit',
3131
forceFilter: true
3232
});
3333
```
3434
#### To check validation
3535

3636
```javascript
37-
myform.check() // True | False
37+
myform.check() // True | False
3838
```
3939

4040
#### To apply on dynamic elements
4141

4242
```javascript
43-
myform.update() // It will update the DOM.```
43+
myform.update() // It will update the DOM.```
4444
```
4545
4646
@@ -54,65 +54,64 @@ It has automated listener to eliminating unnecessary changes on form.
5454
of the Form or any other tags.
5555

5656
```html
57-
<form id="newUser"> </form> // Preferred
57+
<form id="newUser"> </form> // Preferred
5858

59-
<div id=newUser> </div> // Not-Preferred [but it supports]
59+
<div id=newUser> </div> // Not-Preferred.
6060
```
6161
6262
2. Input Fields should specify the type of validation.
6363

6464
#### For General Input Validation
65+
6566
```html
66-
// For Simple Require.
67-
<input type="text" required name="name">
67+
// For Simple Require.
68+
<input type="text" required name="name">
6869

69-
// For Min Restriction.
70-
<input type="text" required min=2 name="name">
70+
// For Min Restriction.
71+
<input type="text" required min=2 name="name">
7172

72-
// For Max Restriction.
73-
<input type="text" required max=16 name="name">
73+
// For Max Restriction.
74+
<input type="text" required max=16 name="name">
7475

75-
// For E-Mail Validation.
76-
<input type="email" required name="name">
76+
// For E-Mail Validation.
77+
<input type="email" required name="name">
7778

78-
// For Password Match Validation.
79-
<input type="password" required match="field_name" name="password">
79+
// For Password Match Validation.
80+
<input type="password" required match="field_name" name="password">
8081
```
8182

8283
#### For Select Validation
8384

84-
```Javascript
85-
//For Simple Required
86-
<select class="" required>
85+
```javascript
86+
<select class="" required>
8787
<option value=""></option>
8888
<option value="...">...</option>
8989
<option value="...">...</option>
9090
<option value="...">...</option>
91-
</select>
91+
</select>
9292
```
9393

9494
#### For Textarea Validation
95-
```Html
96-
97-
// For Simple Required
98-
<textarea required>.....</textarea>
99-
```
95+
96+
```html
97+
<textarea required>.....</textarea>
98+
```
10099
101100
3. Every Input Fields should have a Label with **FOR** attributes.
102101

103-
```Html
102+
```html
104103
<label for="uname">Name :</label>
105104
<input type="text" name="uname" required>
106-
```
105+
```
107106

108107
4. In form use "**novalidate**" to avoid browser interuptions.
109108

110-
````Html
109+
```html
111110
<form method="POST/GET.." action="PATH TO HANDLE" ... novalidate>
112111
...
113112
...
114113
</form>
115-
````
114+
```
116115

117116

118117
It Will listen the **Submit** button event **Automatically**.

0 commit comments

Comments
 (0)