Server IP : 173.249.157.85 / Your IP : 216.73.216.9 Web Server : Apache System : Linux server.frogzhost.com 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 User : econtech ( 1005) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/econtech/www/public/back/assets/js/demo5/pages/custom/apps/contacts/ |
Upload File : |
"use strict"; // Class definition var KTAppsContactsAdd = function () { // Base elements var wizardEl; var formEl; var validator; var wizard; var avatar; // Private functions var initWizard = function () { // Initialize form wizard wizard = new KTWizard('kt_apps_contacts_add', { startStep: 1, }); // Validation before going to next page wizard.on('beforeNext', function(wizardObj) { if (validator.form() !== true) { wizardObj.stop(); // don't go to the next step } }) // Change event wizard.on('change', function(wizard) { KTUtil.scrollTop(); }); } var initValidation = function() { validator = formEl.validate({ // Validate only visible fields ignore: ":hidden", // Validation rules rules: { // Step 1 profile_avatar: { //required: true }, profile_first_name: { required: true }, profile_last_name: { required: true }, profile_phone: { required: true }, profile_email: { required: true, email: true } }, // Display error invalidHandler: function(event, validator) { KTUtil.scrollTop(); swal.fire({ "title": "", "text": "There are some errors in your submission. Please correct them.", "type": "error", "buttonStyling": false, "confirmButtonClass": "btn btn-brand btn-sm btn-bold" }); }, // Submit valid form submitHandler: function (form) { } }); } var initSubmit = function() { var btn = formEl.find('[data-ktwizard-type="action-submit"]'); btn.on('click', function(e) { e.preventDefault(); if (validator.form()) { // See: src\js\framework\base\app.js KTApp.progress(btn); //KTApp.block(formEl); // See: http://malsup.com/jquery/form/#ajaxSubmit formEl.ajaxSubmit({ success: function() { KTApp.unprogress(btn); //KTApp.unblock(formEl); swal.fire({ "title": "", "text": "The application has been successfully submitted!", "type": "success", "confirmButtonClass": "btn btn-secondary" }); } }); } }); } var initAvatar = function() { avatar = new KTAvatar('kt_apps_contacts_add_avatar'); } return { // public functions init: function() { formEl = $('#kt_apps_contacts_add_form'); initWizard(); initValidation(); initSubmit(); initAvatar(); } }; }(); jQuery(document).ready(function() { KTAppsContactsAdd.init(); });