Monday, May 21, 2018

Bootstrap form validation not working without console error

Leave a Comment

This is Simple form.

This is JS code:

$(document).ready(function() {   $('#ledgerHolderjHolderFormEdit').bootstrapValidator({     feedbackIcons: {       valid: 'glyphicon glyphicon-ok',       invalid: 'glyphicon glyphicon-remove',       validating: 'glyphicon glyphicon-refresh'     },     fields: {       JH_INIT: {         validators: {           notEmpty: {             message: "'First Name' is required."           },           regexp: {             regexp: /^07[a-zA-Z0-9.,:;!-@#\$%\^\&*\)\(+=_-`~><|].+$/,             message: "'Mobile Number' must only start with '07'."           },           stringLength: {             min: 5,             max: 30,             message: "'First Name' must be more than 2 and less than 255 characters long."           }         }       }     }   }); }); 

There are no errors show in console, and could not find errors. Can anyone help me?

2 Answers

Answers 1

Solution Found

There are no effect in form and js. Issue was, I wrote html form in 'edit function'(append html form using jQuery). And after validation function wrote in another function. That is the reason.

After many efforts, I wrote validation inside that 'edit function'. The issue was solved.

Answers 2

Make sure you've included JQuery correctly

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment