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,7 +14,7 @@ export const domain_purpose_choice_callbacks = {
//show the purpose details container
showElement(element);
// 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 of using a' +
'subdomain of an existing website.' +
'<br><br>' + // Adding double line break for spacing
@ -37,7 +37,7 @@ export const domain_purpose_choice_callbacks = {
// show the purpose details container
showElement(element);
// 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. ' +
'<span class="usa-label--required">*</span>';
@ -56,7 +56,7 @@ export const domain_purpose_choice_callbacks = {
// Show the purpose details container
showElement(element);
// 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. ' +
'<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
function clearErrors(element) {
// Find the error message div