From fffa0d91da8c5261048bcda6a95762d6ac7014f1 Mon Sep 17 00:00:00 2001 From: zmagod Date: Thu, 15 Dec 2016 16:17:34 +0100 Subject: [PATCH] removes error message from new type/group form [fixes SCI-805] --- app/assets/javascripts/samples/sample_types_groups.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/samples/sample_types_groups.js b/app/assets/javascripts/samples/sample_types_groups.js index 8778f26c0..b80e6e0ed 100644 --- a/app/assets/javascripts/samples/sample_types_groups.js +++ b/app/assets/javascripts/samples/sample_types_groups.js @@ -11,9 +11,12 @@ function newSampleTypeFormCancel() { $('#remove').off(); - $('#remove').on('click', function() { + $('#remove').on('click', function(ev) { + ev.preventDefault(); $('#name-input').val(''); $('.new-resource-form').slideUp(); + $('#new_sample_type').clearFormErrors(); + $('#new_sample_group').clearFormErrors(); }); } @@ -31,7 +34,7 @@ var li = $(this).closest('li'); var href = $(this).attr('data-element'); var id = $(li).attr('data-id'); - $().clearFormErrors(); + $(li).clearFormErrors(); $.ajax({ url: href, data: { id: id },