From 7d093fa11df6371f90e1330b0138331f61990442 Mon Sep 17 00:00:00 2001 From: Zanz2 Date: Fri, 31 Aug 2018 11:18:18 +0200 Subject: [PATCH] Fixed the issue, tested for all 3 reported scenarios --- app/assets/javascripts/protocols/steps.js.erb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/protocols/steps.js.erb b/app/assets/javascripts/protocols/steps.js.erb index 341a2c68c..d6a09a4f9 100644 --- a/app/assets/javascripts/protocols/steps.js.erb +++ b/app/assets/javascripts/protocols/steps.js.erb @@ -546,8 +546,14 @@ var descriptionValid = textValidator(ev, $descrTextarea, 0, <%= Constants::TEXT_MAX_LENGTH %>, false, $tinyMCEInput); var $table_names = $form.find(".table_name"); - var table_nameValid = textValidator(ev, $table_names, 1, - <%= Constants::NAME_MAX_LENGTH %>); + var table_nameValid; + if ($table_names.length > 0) // if table exists check its title, if not, its validated + { + table_nameValid = textValidator(ev, $table_names, 1, + <%= Constants::NAME_MAX_LENGTH %>); + }else{ + table_nameValid = true + } if (DragNDropSteps.filesStatus() && checklistsValid &&