mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 02:36:02 +02:00
cleanup urbanization JS
This commit is contained in:
parent
f7bbed1f03
commit
0986295ab3
2 changed files with 10 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
{% input_with_errors forms.0.zipcode %}
|
||||
{% endwith %}
|
||||
|
||||
<div id="urbanization-field">
|
||||
<div id="urbanization-field" class="display-none">
|
||||
{% input_with_errors forms.0.urbanization %}
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue