Skip to content

Commit

Permalink
show/hide county field pt.2
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Nov 7, 2023
1 parent 2af2fc8 commit 438a97b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
$(document).ready(() => {
$('#form-row-county').hide();
if ($("#id_country").val() !== 'GB') {
$('#form-row-county').hide();
}

$('#id_country').on('change', (event) => {
if (event.target.value == 'GB') {
if (event.target.value === 'GB') {
$('#form-row-county').show();
} else {
$('#form-row-county').hide();
Expand Down
7 changes: 5 additions & 2 deletions portal/templates/portal/teach/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ <h5>Update details of your school or club</h5>
{{ update_school_form.non_field_errors }}
<div class="row form--row">
{% for field in update_school_form %}
<div class="form--row__input col-sm-6 col-md-4">
<div id="form-row-{{ field.name }}" class="form--row__input col-sm-6 col-md-4">
<div class="input--icon">
{{ field }}
{% if not field == update_school_form.country %}
{% if not field == update_school_form.country and not field == update_school_form.county %}
<span class="iconify" data-icon="mdi:domain"></span>
{% endif %}
</div>
Expand Down Expand Up @@ -553,4 +553,7 @@ <h5>Delete account</h5>
</div>
</div>

<script type="text/javascript"
src="{% static 'portal/js/school.js' %}"></script>

{% endblock content %}
2 changes: 1 addition & 1 deletion portal/templates/portal/teach/onboarding_school.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ <h4>Create a school or club</h4>
{% endif %}

<script type="text/javascript"
src="{% static 'portal/js/onboarding_school.js' %}"></script>
src="{% static 'portal/js/school.js' %}"></script>

{% endblock content %}

0 comments on commit 438a97b

Please sign in to comment.