Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function confirmInput (e) {
const input = e.target
// using slugify and also stripping out the (in)definite article (the/a/an)
let value = input.dataset.confirmationFilter === 'slugify' ? slugify(removeIndefiniteArticles(input.value)) : input.value
const confirmationId = `${input.id}-confirmation`
const confirmationPrepend = input.dataset.confirmationPrepend || ''
let confirmation = document.getElementById(confirmationId)
if (!confirmation) {
confirmation = document.createElement('div')
confirmation.innerHTML = `
<div class="govuk-inset-text input-confirm" id="${confirmationId}">
<h3 class="govuk-heading-s govuk-!-margin-bottom-2">${input.dataset.confirmationTitle}</h3>
<p class="govuk-body">
${input.dataset.confirmationLabel}<span class="input-confirmation"></span>
</p>
</div>`
input.closest('.govuk-form-group').after(confirmation)
}
const makeNiceURL = string => {
return slugify(removeIndefiniteArticles(string))
}
const makeNiceURL = string => {
return slugify(removeIndefiniteArticles(string))
}