1/** 2 * App User View - Security 3 */ 4 5'use strict'; 6 7(function () { 8 const formChangePass = document.querySelector('#formChangePassword'); 9 10 // Form validation for Change password 11 if (formChangePass) { 12 const fv = FormValidation.formValidation(formChangePass, { 13 fields: { 14 newPassword: { 15 validators: { 16 notEmpty: { 17 message: 'Please enter new password' 18 }, 19 stringLength: { 20 min: 8, 21 message: 'Password must be more than 8 characters' 22 } 23 } 24 }, 25 confirmPassword: { 26 validators: { 27 notEmpty: { 28 message: 'Please confirm new password' 29 }, 30 identical: { 31 compare: function () { 32 return formChangePass.querySelector('[name="newPassword"]').value; 33 }, 34 message: 'The password and its confirm are not the same' 35 }, 36 stringLength: { 37 min: 8, 38 message: 'Password must be more than 8 characters' 39 } 40 } 41 } 42 }, 43 plugins: { 44 trigger: new FormValidation.plugins.Trigger(), 45 bootstrap5: new FormValidation.plugins.Bootstrap5({ 46 eleValidClass: '', 47 rowSelector: '.form-password-toggle' 48 }), 49 submitButton: new FormValidation.plugins.SubmitButton(), 50 // Submit the form when all fields are valid 51 // defaultSubmit: new FormValidation.plugins.DefaultSubmit(), 52 autoFocus: new FormValidation.plugins.AutoFocus() 53 }, 54 init: instance => { 55 instance.on('plugins.message.placed', function (e) { 56 if (e.element.parentElement.classList.contains('input-group')) { 57 e.element.parentElement.insertAdjacentElement('afterend', e.messageElement); 58 } 59 }); 60 } 61 }); 62 } 63})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.