Skip to content

Commit 372b86b

Browse files
Update README.md
1 parent 3bf0ad3 commit 372b86b

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

README.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Then Integrate your form with Validator.
7575
| maxLength="10" | Integer | To set the Maximum length of characters to proceed. |
7676
| type="password" | AlphaNumeric | To set and compare password. |
7777
| type="email" | AlphaNumeric | To check the email is valid or not. |
78+
| type="file" | string ['png,jpeg..'] | To check the file format is allowed or not. |
7879
| data-message="Error Message"| String | User defined, element based direct error message to handle. |
7980
| data-allow="onlyAlpha"| a-zA-Z Only | Allow only string, no digits and no special characters. |
8081
| data-allow="string"| a-zA-Z0-9 Only | Allow only string and digits, no special characters. |
@@ -129,6 +130,10 @@ It has automated listener to monitor every changes on form.
129130
<label>Email Validator</label>
130131
<input type="email" name="email" required>
131132
</div>
133+
<div>
134+
<label for="file">File</label>
135+
<input type="file" required class="form-control" id="file" data-extensions="png,jpeg,jpg" name="file">
136+
</div>
132137
<div>
133138
<label>Password</label>
134139
<input type="password" name="password" data-check="repassword" id="password" required>
@@ -175,29 +180,17 @@ It has automated listener to monitor every changes on form.
175180

176181
```javascript
177182

178-
// For Native-Javascript
179-
var myform = jsValidator.init({
180-
form: 'form2submit', // #id
181-
forceFilter: true,
182-
message: {
183-
required: 'This field is required !',
184-
min: '<br><span style="color: red;">This field is less then the limit [INDEX]</span>',
185-
max: 'This field is exceeds the limit of [INDEX]',
186-
password: 'Password doesn\'t match !',
187-
email: 'Invalid Email found !'
188-
}
189-
});
190-
191-
// For ES6
183+
// For Native-Javascript & ES6
192184
var myform = new jsValidator().init({
193185
form: 'form2submit', // #id
194186
forceFilter: true,
195187
message: {
196188
required: 'This field is required !',
197-
min: '<br><span style="color: red;">This field is less then the limit [INDEX]</span>',
198-
max: 'This field is exceeds the limit of [INDEX]',
189+
min: '<br><span style="color: red;">This field is less then the limit</span>',
190+
max: 'This field is exceeds the limit',
199191
password: 'Password doesn\'t match !',
200-
email: 'Invalid Email found !'
192+
email: 'Invalid Email found !',
193+
file: 'Invalid File format given'
201194
}
202195
});
203196

0 commit comments

Comments
 (0)