People risk report 2022 (2024)

` ); } } const spinner = '

'; form.getFormElem().closest("body").append(spinner); /** * This module is responsible for handling file input fields on the dom. * There are at anytime 1-3 file input fields. * * When user selects a file then module will add another file input field to the dom, * (provided that the LIMIT has not been reached). Also if user deselects a file * input field the module will delete file input field to the bottom (if it is not * the bottom input field) */ const fileInputListModule = (function ($fileInput, $) { const fileInputList = []; const fileInputContainer = formEle.querySelector('.file-input-container'); let incrementor = 0; let $fileError = null; // Initialize the first file input field already on DOM fileInputList.push($fileInput); $fileInput.change(handleChange); /** * Provides a copy of the fileInputList */ function getFileList() { return fileInputList.slice(0); } function setFileError(fileName,errorMsg) { fileName.closest(".mktoFormRow").find(".mktoError").remove(); fileName.parent().after( `

` + errorMsg + `

` ); fileName[0].classList.add("mktoInvalid"); } function removeFileError(fileName) { $(fileInputContainer).find(".mktoError").remove(); fileName[0]?.classList.remove("mktoInvalid"); } function handleDeleteBtn(e) { const target = e.currentTarget; const $inputEl = $(target.parentNode).closest('.input-upload-wrapper').find('input'); const inputIndex = findIndex($inputEl); if (inputIndex > -1 && LIMIT > 1) { removeInput(inputIndex); } else { // If there's only a single upload field, just remove the delete button target.removeEventListener('click', handleDeleteBtn); target.remove(); $inputEl.removeClass('hideChooseButton'); $inputEl.val(''); } // When the number of input fields reaches the limit and one of them is removed, add // an input field with the Choose File button visible if (fileInputList.every($input => $input.hasClass('hideChooseButton')) || !fileInputList?.length) { addNewInput(false); } // when Upload Required is checked and all input with a file is removed, show the error if (uploadRequired && fileInputList.every($input => !$input.val().length)) { setFileError(fileInputList[fileInputList.length - 1], "This is required") } } function addDeleteBtn(el) { const ariaLabel = "Remove file"; el.parentNode.insertAdjacentHTML('beforeend', `

People risk report 2022 (2024)
Top Articles
Latest Posts
Article information

Author: Lakeisha Bayer VM

Last Updated:

Views: 5737

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Lakeisha Bayer VM

Birthday: 1997-10-17

Address: Suite 835 34136 Adrian Mountains, Floydton, UT 81036

Phone: +3571527672278

Job: Manufacturing Agent

Hobby: Skimboarding, Photography, Roller skating, Knife making, Paintball, Embroidery, Gunsmithing

Introduction: My name is Lakeisha Bayer VM, I am a brainy, kind, enchanting, healthy, lovely, clean, witty person who loves writing and wants to share my knowledge and understanding with you.