This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
function dependentCheckboxField(checkboxName, dependentFieldName) { | |
function normalizeString(str) { | |
return str.toLocaleLowerCase().replace(/\s/g, '').trim(); | |
} | |
function findPardotFormFieldByLabel(label) { | |
for (const labelEl of document.querySelectorAll('#pardot-form label')) { | |
if (normalizeString(labelEl.innerHTML + '') === normalizeString(label)) | |
return labelEl.parentElement; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const pathJoin = (base, ...parts) => { | |
const trimSepRight = /\/+$/g; | |
const trimSepLeftRight = /^\/+|\/+$/g; | |
const partsTrimmed = parts.map(p => p.replace(trimSepLeftRight, '')); | |
return [base.replace(trimSepRight, '')].concat(partsTrimmed).join('/'); | |
}; |