diff --git a/app/views/shared/_my_org.html.erb b/app/views/shared/_my_org.html.erb index 375c9ef..592a778 100644 --- a/app/views/shared/_my_org.html.erb +++ b/app/views/shared/_my_org.html.erb @@ -14,10 +14,11 @@ <% if allow_other_orgs %>
<%= f.hidden_field :other_org_id, value: other_org.present? ? other_org.id : '' %> + <%= f.hidden_field :other_org_name, value: other_org.present? ? other_org.name : '' %> <%= _('My organisation isn\'t listed.') %>
- <%= f.text_field :other_organisation, autocomplete: "off", class: "form-control hide other-org", + <%= f.text_field :other_organisation, autocomplete: "off", class: "form-control hide other-org", placeholder: _('Please enter the name of your organisation'), "aria-label": "other_organisation" %> <% end %> diff --git a/lib/assets/javascripts/views/shared/my_org.js b/lib/assets/javascripts/views/shared/my_org.js index a38eb26..05efddf 100644 --- a/lib/assets/javascripts/views/shared/my_org.js +++ b/lib/assets/javascripts/views/shared/my_org.js @@ -8,9 +8,11 @@ if (isObject(div)) { const combo = div.find('input.js-combobox'); const id = div.find('input.org-id'); + const name = div.find('input[name="user[org_name]"]'); const text = div.find('input.other-org'); const link = div.find('a.other-org-link'); const otherOrg = div.find('input[name="user[other_org_id]"]'); + const otherOrgName = div.find('input[name="user[other_org_name]"]'); const toggleInputs = (showCombo) => { if (showCombo) { @@ -36,6 +38,7 @@ text.blur(() => { if (isObject(id)) { id.val(text.val().length > 0 ? otherOrg.val() : ''); + name.val(text.val().length > 0 ? otherOrgName.val() : ''); } });