Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/demo/index3.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@
<button type="submit" name="btn-save" class="btn btn-default">Submit</button>
</form>
</div>
<script src="./../js/formValidator.js"></script>
<!--<script src="../js/formValidator.es6.min.js"></script>-->
<script src="./../js/multi_formValidator.js"></script>

<script>

Expand All @@ -106,12 +105,13 @@
// }
// });

var form = jsValidator.init({
var form = new jsValidator();
form.init({
form: 'clientAdd',
forceFilter: true,
onChange: true,
errorClass: '__error_cap',
// log:true,
log: true,
message: {
required: 'This field is required.',
min: 'This field length is too low.',
Expand Down
2 changes: 1 addition & 1 deletion src/js/formValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ var jsValidator = {
// Apply filter for Email elements.
if (activeElem.type == 'email') jsFilter.email(activeElem);
// Apply filter for Numeric elements.
// if (activeElem.min || activeElem.max || activeElem.minLength || activeElem.maxLength) jsFilter.limit(activeElem);
if (activeElem.min || activeElem.max || activeElem.minLength || activeElem.maxLength) jsFilter.limit(activeElem);
// Apply filter File elements.
if (activeElem.type == 'file') jsFilter.file(activeElem);
// Apply filter with string, alphaNumeric and pregMatch.
Expand Down
Loading