fix broken javascript

This commit is contained in:
matthewswspence 2025-03-28 12:45:21 -05:00
parent ceeb537a07
commit 0545dbcc6d
No known key found for this signature in database
GPG key ID: FB458202A7852BA4

View file

@ -14,8 +14,8 @@ export const domain_purpose_choice_callbacks = {
//show the purpose details container //show the purpose details container
showElement(element); showElement(element);
// change just the text inside the em tag // change just the text inside the em tag
const labelElement = element.querySelector('.usa-label em'); const labelElement = element.querySelector('p em');
labelElement.innerHTML = 'Explain why a new domain is need instead ofusing a' + labelElement.innerHTML = 'Explain why a new domain is need instead of using a' +
'subdomain of an existing website.' + 'subdomain of an existing website.' +
'<br><br>' + // Adding double line break for spacing '<br><br>' + // Adding double line break for spacing
'Include any information or data that shows how the new domain would ' + 'Include any information or data that shows how the new domain would ' +
@ -37,7 +37,7 @@ export const domain_purpose_choice_callbacks = {
// show the purpose details container // show the purpose details container
showElement(element); showElement(element);
// change just the text inside the em tag // change just the text inside the em tag
const labelElement = element.querySelector('.usa-label em'); const labelElement = element.querySelector('p em');
labelElement.innerHTML = 'Explain why a redirect is necessary. ' + labelElement.innerHTML = 'Explain why a redirect is necessary. ' +
'<span class="usa-label--required">*</span>'; '<span class="usa-label--required">*</span>';
@ -56,7 +56,7 @@ export const domain_purpose_choice_callbacks = {
// Show the purpose details container // Show the purpose details container
showElement(element); showElement(element);
// change just the text inside the em tag // change just the text inside the em tag
const labelElement = element.querySelector('.usa-label em'); const labelElement = element.querySelector('p em');
labelElement.innerHTML = 'Describe how this domain will be used. ' + labelElement.innerHTML = 'Describe how this domain will be used. ' +
'<span class="usa-label--required">*</span>'; '<span class="usa-label--required">*</span>';
@ -67,19 +67,6 @@ export const domain_purpose_choice_callbacks = {
} }
} }
// Function to check if errors are currently displayed
function checkForErrors(element) {
const errorMessage = element.querySelector('#id_purpose-purpose__error-message');
const formGroup = element.querySelector('.usa-form-group.usa-form-group--error');
// If either errors exist, set the flag to true
if (errorMessage || formGroup) {
errorsHaveBeenDisplayed = true;
}
return errorsHaveBeenDisplayed;
}
// Helper function to clear error messages in a textarea // Helper function to clear error messages in a textarea
function clearErrors(element) { function clearErrors(element) {
// Find the error message div // Find the error message div