Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdawson1982 committed Jul 5, 2024
1 parent 54bdbff commit eef0657
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 11 additions & 2 deletions home/forms/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class SearchForm(forms.Form):
"form": "searchform",
"class": "govuk-select",
"aria-label": "Domain",
"oninput": "submitForm()",
}
),
)
Expand All @@ -107,14 +108,22 @@ class SearchForm(forms.Form):
choices=get_where_to_access_choices,
required=False,
widget=forms.CheckboxSelectMultiple(
attrs={"class": "govuk-checkboxes__input", "form": "searchform"}
attrs={
"class": "govuk-checkboxes__input",
"form": "searchform",
"oninput": "submitForm()",
}
),
)
entity_types = forms.MultipleChoiceField(
choices=get_entity_types,
required=False,
widget=forms.CheckboxSelectMultiple(
attrs={"class": "govuk-checkboxes__input", "form": "searchform"}
attrs={
"class": "govuk-checkboxes__input",
"form": "searchform",
"oninput": "submitForm()",
}
),
)
sort = forms.ChoiceField(
Expand Down
6 changes: 6 additions & 0 deletions templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ <h2 class="govuk-heading-l govuk-!-display-inline-block" id="result-count">{{tot
</div>
{% endblock content %}
{% block scripts %}
<script>
function submitForm() {
var form = document.getElementById('searchform')
form.submit();
}
</script>
<script type="module">
import {initDomainFilter} from "{% static 'assets/js/enhanced-search.js' %}"
initDomainFilter();
Expand Down

0 comments on commit eef0657

Please sign in to comment.