diff --git a/openatlas/static/js/forms.js b/openatlas/static/js/forms.js index f72c2a4ca..f33f6b3ea 100644 --- a/openatlas/static/js/forms.js +++ b/openatlas/static/js/forms.js @@ -188,7 +188,7 @@ $(document).ready(function () { // Add required to reference precision if reference is set ['keyup', 'change'].forEach((listener) => { - $("[id^=reference_system_value]").on(listener, function () { + $("[id^=reference_system_id]").on(listener, function () { const select = $(`#reference_system_precision_${this.id.split('_').pop()}`); if (!this.value?.length) select.removeClass('required'); diff --git a/openatlas/templates/forms/reference_field.html b/openatlas/templates/forms/reference_field.html index f506e188b..4538c0dc7 100644 --- a/openatlas/templates/forms/reference_field.html +++ b/openatlas/templates/forms/reference_field.html @@ -4,9 +4,9 @@ autocomplete="off" style="position: relative" value="{{ field.data['value'] or '' }}" - id="reference_system_value_{{ field.reference_system_id }}" - placeholder="{{ field.placeholder }}" + id="reference_system_id_{{ field.reference_system_id }}" name="reference_system_id_{{ field.reference_system_id }}" + placeholder="{{ field.placeholder }}" type="text" class="{{ config.CSS.string_field }}" data-reference-system="{{ field.label.text.replace(' ','-') }}">