chess/public/assets/js/pages/custom/user/add-user.min.js

1 line
2.2 KiB
JavaScript
Raw Permalink Normal View History

2024-08-29 03:56:32 +00:00
"use strict";var KTAddUser=function(){var e,t,a,i=[];return{init:function(){e=KTUtil.getById("kt_wizard"),t=KTUtil.getById("kt_form"),(a=new KTWizard(e,{startStep:1,clickableSteps:!0})).on("beforeNext",function(e){a.stop(),i[e.getStep()-1].validate().then(function(e){"Valid"==e?(a.goNext(),KTUtil.scrollTop()):Swal.fire({text:"Sorry, looks like there are some errors detected, please try again.",icon:"error",buttonsStyling:!1,confirmButtonText:"Ok, got it!",customClass:{confirmButton:"btn font-weight-bold btn-light"}}).then(function(){KTUtil.scrollTop()})})}),a.on("change",function(e){KTUtil.scrollTop()}),i.push(FormValidation.formValidation(t,{fields:{firstname:{validators:{notEmpty:{message:"First Name is required"}}},lastname:{validators:{notEmpty:{message:"Last Name is required"}}},companyname:{validators:{notEmpty:{message:"Company Name is required"}}},phone:{validators:{notEmpty:{message:"Phone is required"},phone:{country:"US",message:"The value is not a valid US phone number. (e.g 5554443333)"}}},email:{validators:{notEmpty:{message:"Email is required"},emailAddress:{message:"The value is not a valid email address"}}},companywebsite:{validators:{notEmpty:{message:"Website URL is required"}}}},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap:new FormValidation.plugins.Bootstrap}})),i.push(FormValidation.formValidation(t,{fields:{communication:{validators:{choice:{min:1,message:"Please select at least 1 option"}}},language:{validators:{notEmpty:{message:"Please select a language"}}},timezone:{validators:{notEmpty:{message:"Please select a timezone"}}}},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap:new FormValidation.plugins.Bootstrap}})),i.push(FormValidation.formValidation(t,{fields:{address1:{validators:{notEmpty:{message:"Address is required"}}},postcode:{validators:{notEmpty:{message:"Postcode is required"}}},city:{validators:{notEmpty:{message:"City is required"}}},state:{validators:{notEmpty:{message:"state is required"}}},country:{validators:{notEmpty:{message:"Country is required"}}}},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap:new FormValidation.plugins.Bootstrap}})),new KTImageInput("kt_user_add_avatar")}}}();jQuery(document).ready(function(){KTAddUser.init()});