diff --git a/app/views/plans/new.html.erb b/app/views/plans/new.html.erb
index b336152..bf2fc52 100644
--- a/app/views/plans/new.html.erb
+++ b/app/views/plans/new.html.erb
@@ -34,6 +34,8 @@
default_selection: @default_org,
models: @orgs,
attribute: 'name',
+ tooltip: _('Please select a valid research organisation from the list.'),
+ error: _('You must select a research organisation from the list.'),
classes: 'input-full-width'} %>
@@ -59,7 +61,8 @@
default_selection: nil,
models: @funders,
attribute: 'name',
- tooltip: _('Please select a valid funding organisation from the list'),
+ tooltip: _('Please select a valid funding organisation from the list.'),
+ error: _('You must select a funding organisation from the list.'),
classes: 'input-full-width'} %>
diff --git a/app/views/shared/_accessible_combobox.html.erb b/app/views/shared/_accessible_combobox.html.erb
index 94d4182..95f2f3b 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.') %>
" name="<%= name.gsub("_#{attribute}]", "_id]") %>"
value="<%= default_selection.id unless default_selection.nil? %>" />
- " class="error-tooltip left-indent">
-
+
<% else %>
diff --git a/lib/assets/javascripts/views/plans/new.js b/lib/assets/javascripts/views/plans/new.js
index 01712f7..2391ec9 100644
--- a/lib/assets/javascripts/views/plans/new.js
+++ b/lib/assets/javascripts/views/plans/new.js
@@ -19,16 +19,6 @@
handleComboboxChange();
});
- // If there was no selection, highlight the box and display tooltip
- $("#plan_funder_name").blur(function(){
- var msg = ($("#plan_funder_id").val().trim().length <= 0 ? __('Please select a valid funding organisation from the list') : '');
- toggleFormElementError($(this), msg);
- });
- $("#plan_org_name").blur(function(){
- var msg = ($("#plan_org_id").val().trim().length <= 0 ? __('Please select a valid research organisation from the list') : '');
- toggleFormElementError($(this), msg);
- });
-
// Make sure the checkbox is unchecked if we're entering text
$(".js-combobox").keyup(function(){
var whichOne = $(this).prop('id').split('_')[1];
diff --git a/lib/assets/stylesheets/dmproadmap/forms.scss b/lib/assets/stylesheets/dmproadmap/forms.scss
index e41ae5c..00cf310 100644
--- a/lib/assets/stylesheets/dmproadmap/forms.scss
+++ b/lib/assets/stylesheets/dmproadmap/forms.scss
@@ -277,7 +277,7 @@
box-shadow: 0 0 6px $error-background;
}
- .error-tooltip, .error-tooltip-right, .submit-tooltip {
+ .error-tooltip, .error-tooltip-right, .error-tooltip-top, .submit-tooltip {
display: none;
width: 45%;
background: $error-background;
@@ -293,6 +293,7 @@
position: absolute;
z-index: 9;
}
+
.error-tooltip[role='alert']:before, .submit-tooltip[role='tooltip']:before {
display: inline;
position: absolute;
@@ -302,6 +303,23 @@
color: $error-background;
font-size: 44px;
}
+
+ .error-tooltip-top[role='alert'] {
+ top: -35px;
+ left: 0;
+ display: inline;
+ position: absolute;
+ z-index: 9;
+ }
+ .error-tooltip-top[role='alert']:before {
+ display: inline;
+ position: absolute;
+ margin: 0 auto;
+ top: 30px;
+ @include icon(caret-down);
+ color: $error-background;
+ font-size: 44px;
+ }
.error-tooltip-right[role="alert"], .error-tooltip-right[role="tooltip"] {
top: 0;