Skip to content

Commit

Permalink
Merge pull request #3184 from cisagov/rjm/3183-stray-js
Browse files Browse the repository at this point in the history
#3183: Remove stray JS from org contact template - [RJM]
rachidatecs authored Dec 5, 2024
2 parents 6fb56fe + 84a2bf5 commit d3a7f45
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 9 additions & 3 deletions src/registrar/assets/src/js/getgov/urbanization.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { hideElement, showElement } from './helpers.js';

function setupUrbanizationToggle(stateTerritoryField) {
var urbanizationField = document.getElementById('urbanization-field');
let urbanizationField = document.getElementById('urbanization-field');
if (!urbanizationField) {
console.error("Cannot find expect field: #urbanization-field");
return;
}

function toggleUrbanizationField() {
// Checking specifically for Puerto Rico only
if (stateTerritoryField.value === 'PR') {
urbanizationField.style.display = 'block';
showElement(urbanizationField);
} else {
urbanizationField.style.display = 'none';
hideElement(urbanizationField);
}
}

5 changes: 1 addition & 4 deletions src/registrar/templates/domain_request_org_contact.html
Original file line number Diff line number Diff line change
@@ -37,12 +37,9 @@ <h2>What is the name and mailing address of the organization you represent?</h2>
{% input_with_errors forms.0.zipcode %}
{% endwith %}

<div id="urbanization-field" style="display: none;">
<div id="urbanization-field" class="display-none">
{% input_with_errors forms.0.urbanization %}
</div>

</fieldset>
{% endblock %}

<script src="{% static 'js/getgov.min.js' %}" defer></script>

0 comments on commit d3a7f45

Please sign in to comment.