@@ -75,6 +75,7 @@ Then Integrate your form with Validator.
75
75
| maxLength="10" | Integer | To set the Maximum length of characters to proceed. |
76
76
| type="password" | AlphaNumeric | To set and compare password. |
77
77
| 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. |
78
79
| data-message="Error Message"| String | User defined, element based direct error message to handle. |
79
80
| data-allow="onlyAlpha"| a-zA-Z Only | Allow only string, no digits and no special characters. |
80
81
| 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.
129
130
<label >Email Validator</label >
130
131
<input type =" email" name =" email" required >
131
132
</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 >
132
137
<div >
133
138
<label >Password</label >
134
139
<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.
175
180
176
181
```javascript
177
182
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
192
184
var myform = new jsValidator().init({
193
185
form: 'form2submit', // #id
194
186
forceFilter: true,
195
187
message: {
196
188
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',
199
191
password: 'Password doesn\'t match !',
200
- email: 'Invalid Email found !'
192
+ email: 'Invalid Email found !',
193
+ file: 'Invalid File format given'
201
194
}
202
195
});
203
196
0 commit comments