diff --git a/app/views/shared/_accessible_combobox.html.erb b/app/views/shared/_accessible_combobox.html.erb index 1bfef5e..d4b5666 100644 --- a/app/views/shared/_accessible_combobox.html.erb +++ b/app/views/shared/_accessible_combobox.html.erb @@ -1,6 +1,7 @@ <% if !models.nil? %> <% json = {} %> <% models.map{|m| json[m[attribute]] = m.id} %> + <% err_msg = error ||= __('Please select an item from the list.') %> _crosswalk[$(this).val().trim()] == undefined && $(this).val().trim().length > 1){ - $("#<%= id %>_error").html("<%= error %>").attr('role', 'alert'); + $("#<%= id %>_error").html("<%= err_msg %>").attr('role', 'alert'); $("#<%= id %>").addClass('red-border'); }else{ $("#<%= id %>_error").html("").attr('role', ''); @@ -76,7 +77,7 @@ $("#<%= id %>_error").html("").attr('role', ''); $("#<%= id %>").removeClass('red-border'); }else{ - $("#<%= id %>_error").html("<%= error %>").attr('role', 'alert'); + $("#<%= id %>_error").html("<%= err_msg %>").attr('role', 'alert'); $("#<%= id %>").addClass('red-border'); } });