jqbootstrapvalidation

How to set minSize in Bootstrap Validator

﹥>﹥吖頭↗ 提交于 2020-01-02 14:03:53
问题 I'm trying to figure out how to set the minSize for a file upload using Bootstrap Validator plugin. Given the following code, I can set the maxSize maxSize , but not minSize $(document).ready(function () { $('#test').bootstrapValidator({ live: 'enabled', fields: { fileupload: { validators: { file: { extension: 'png', type: 'image/png', maxSize: 1024 * 1024, message: 'The selected file is not valid, or the size is not large enough!' } } } } }); }); Is there a way to set it for minSize? 回答1: as

How to set minSize in Bootstrap Validator

心不动则不痛 提交于 2020-01-02 14:03:22
问题 I'm trying to figure out how to set the minSize for a file upload using Bootstrap Validator plugin. Given the following code, I can set the maxSize maxSize , but not minSize $(document).ready(function () { $('#test').bootstrapValidator({ live: 'enabled', fields: { fileupload: { validators: { file: { extension: 'png', type: 'image/png', maxSize: 1024 * 1024, message: 'The selected file is not valid, or the size is not large enough!' } } } } }); }); Is there a way to set it for minSize? 回答1: as

Bootstrap Validator submits form even if there is a validation error

断了今生、忘了曾经 提交于 2019-12-25 08:56:49
问题 I have the following image where you can plainly see that the field is required after I submit the form. However, after submitting the form, it continues on to the button click event in the JS instead of stopping the form submission. What am I missing here with BootStrap Validator where I can prevent the form from being submitted if there are validation errors? Here is my HTML5 MasterPage pertinent parts <script src="../Content/lib/assets/js/validator.js"></script> <script src="../Content/lib

Bootstrap Validator - Alert on success validation

£可爱£侵袭症+ 提交于 2019-12-24 03:34:39
问题 I'm using Bootstrap Validator plugin to validate my form and I'm trying to do an alert when the form is successfully validated. HTML <form id="defaultForm" role="form"> <div class="form-group"> <label for="eventName">Event Name</label> <input type="text" class="input-sm form-control" id="eventName" name="name" placeholder="..."> </div> <button class="btn btn-sm">Add</button> </form> JS $('#defaultForm').bootstrapValidator({ live: 'enabled', fields: { name: { validators: { notEmpty: { message:

Bootstrap validator for modal doesnt reset Form

孤街浪徒 提交于 2019-12-21 18:42:14
问题 I am using bootstrap validator for my form inside modal.The validator gets retained on subsequent form access. For example if the do the following operation Access form enter some valid value and submit the form. Access the form again the color of the field still remain in green , since i entered a valid entry in my previous form submission <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class=

Bootstrap validator for modal doesnt reset Form

99封情书 提交于 2019-12-21 18:42:10
问题 I am using bootstrap validator for my form inside modal.The validator gets retained on subsequent form access. For example if the do the following operation Access form enter some valid value and submit the form. Access the form again the color of the field still remain in green , since i entered a valid entry in my previous form submission <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class=

Maximum call stack size exceeded when changing a class - Bootstrap, jQuery

强颜欢笑 提交于 2019-12-10 16:56:40
问题 I'm using jQuery 2.1.1, jQuery UI 1.11, Bootstrap 3.2, Fuel UX 2.3 (for the form wizard only) and BootstrapValidator v0.5.1-dev. I have a huge bootstrapped form in a Fuel UX Wizard, with BootstrapValidator validation, along with a ton of jQuery for events and stuff(the total page is 1900 lines, that's why i haven't provided any code). I had a div with class col-xs-8 around all of my form, everything was working fine. Then i changed it to class="container" (only change in the code, played it a

Bootstrap form validation not working

雨燕双飞 提交于 2019-12-10 12:25:33
问题 I am trying to validate username and password field using bootstrap validator I have included css and js for bootstrap validator. form id to validate is #login Code is as below <head> <script type='text/javascript' src='js/jquery-2.1.1.min.js'></script> <script type="text/javascript" src="js/jquery-ui.js"></script> <link rel="stylesheet" href="js/bootstrap-3.1.1-dist/css/bootstrap.min.css"/> <link rel="stylesheet" href="js/bootstrap-3.1.1-dist/css/bootstrap-theme.min.css"/> <script type='text

bootstrapValidator: How do you add and remove validators dynamically to an existing input field?

别说谁变了你拦得住时间么 提交于 2019-12-10 10:57:49
问题 I have a dynamic form that is bound with knockout.js and validated by bootstrapValidator . There is one input field that needs to be 'required-validated' dependent on the state of another control. The input field: <textarea id="inputReason" name="inputReason" rows="3" class="form-control col-lg-8" data-bind="value: Reason" /> The relevant javascript part of the knockout-viewmodel: self.SelectAbsenceType = function (absenceType) { self.SelectedID(absenceType.ID); if (self.SelectedAbsenceType()

bootstrapvalidator gives “Cannot read property 'group' of undefined” on ckeditor field

那年仲夏 提交于 2019-12-08 07:14:44
问题 I'm using ckeditor on a text area and I need to set a custom validation. Following the example, I set the textbox using the jquery adapter in this way: $('#posteditor') .bootstrapValidator() .find('[name="text"]').ckeditor({ skin: 'moono,/asset/css/moono/', language: 'it', toolbarGroups: [ {"name":"basicstyles","groups":["basicstyles"]}, {"name":"paragraph","groups":["list","align"]}, {"name":"insert","groups":["insert"]}, {"name":"styles","groups":["styles"]}, {"name":"links","groups":[