Server IP : 150.95.80.236 / Your IP : 18.216.34.208 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/uat.pcu.in.th/demo15/src/js/custom/pages/projects/settings/ |
Upload File : |
"use strict"; // Class definition var KTProjectSettings = function () { // Private functions var handleForm = function () { // Init Datepicker --- For more info, please check Flatpickr's official documentation: https://flatpickr.js.org/ $("#kt_datepicker_1").flatpickr(); // Form validation var validation; var _form = document.getElementById('kt_project_settings_form'); var submitButton = _form.querySelector('#kt_project_settings_submit'); // Init form validation rules. For more info check the FormValidation plugin's official documentation:https://formvalidation.io/ validation = FormValidation.formValidation( _form, { fields: { name: { validators: { notEmpty: { message: 'Project name is required' } } }, type: { validators: { notEmpty: { message: 'Project type is required' } } }, description: { validators: { notEmpty: { message: 'Project Description is required' } } }, date: { validators: { notEmpty: { message: 'Due Date is required' } } }, }, plugins: { trigger: new FormValidation.plugins.Trigger(), submitButton: new FormValidation.plugins.SubmitButton(), //defaultSubmit: new FormValidation.plugins.DefaultSubmit(), // Uncomment this line to enable normal button submit after form validation bootstrap: new FormValidation.plugins.Bootstrap5({ rowSelector: '.fv-row' }) } } ); submitButton.addEventListener('click', function (e) { e.preventDefault(); validation.validate().then(function (status) { if (status == 'Valid') { swal.fire({ text: "Thank you! You've updated your project settings", icon: "success", buttonsStyling: false, confirmButtonText: "Ok, got it!", customClass: { confirmButton: "btn fw-bold btn-light-primary" } }); } else { swal.fire({ text: "Sorry, looks like there are some errors detected, please try again.", icon: "error", buttonsStyling: false, confirmButtonText: "Ok, got it!", customClass: { confirmButton: "btn fw-bold btn-light-primary" } }); } }); }); } // Public methods return { init: function () { handleForm(); } } }(); // On document ready KTUtil.onDOMContentLoaded(function() { KTProjectSettings.init(); });