From 9f067249de749455d38f68e59fc033f3b4b574fb Mon Sep 17 00:00:00 2001 From: James Graham Date: Sun, 21 Mar 2021 11:59:29 +0000 Subject: [PATCH] fix: show free text for 'other' in multi-select Resolves #104 Should resolve #101 See #75 --- people/templates/people/person/update.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/people/templates/people/person/update.html b/people/templates/people/person/update.html index 0ed58a9..1049a8b 100644 --- a/people/templates/people/person/update.html +++ b/people/templates/people/person/update.html @@ -62,7 +62,14 @@ } function setFreeTextState(select, freeTextField) { - if (select.selectedOptions[0].text.toLowerCase().startsWith('other')) { + var other_selected = false; + for (var i = 0; i < select.selectedOptions.length; i++) { + if (select.selectedOptions[i].text.toLowerCase().startsWith('other')) { + other_selected = true; + } + } + + if (other_selected) { freeTextField.show(); } else { freeTextField.hide();