My goal is a validated field (s) that has a class name or identifier using the bootstrap validator
Here is a sample code:
HTML:
<input id="myFirstId" class="myClass" type="text" name="myFirstName" /> <input id="mySecondId" class="myClass" type="text" name="myLastName" />
JS:
$('#myForm').bootstrapValidator({ fields : { myFirstName : { validators : { notEmpty : { message : 'required' } } }, myLastName : { validators : { notEmpty : { message : 'required' } } } } });
but I want one block to check these two elements using the bootstrap validator
ex.
$('#myForm').bootstrapValidator({ fields : { myClass : { // <-- this is not working but i want to validate those // object with has 'myClass' class. validators : { notEmpty : { message : 'required' } } } } });
source share