From 1ee2f64f13b02f57619b0dedef27a52924ba1f61 Mon Sep 17 00:00:00 2001 From: hudajkhan Date: Mon, 9 Dec 2013 11:03:58 -0500 Subject: [PATCH] VIVO627 submission validation for default template for multiple content types fixed to check for number of content types --- webapp/web/js/menupage/pageManagementUtils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webapp/web/js/menupage/pageManagementUtils.js b/webapp/web/js/menupage/pageManagementUtils.js index 54b6cfa45..f0dd32258 100644 --- a/webapp/web/js/menupage/pageManagementUtils.js +++ b/webapp/web/js/menupage/pageManagementUtils.js @@ -905,9 +905,11 @@ var pageManagementUtils = { validationErrorMsg = pageManagementUtils.selectContentType + "
"; } else { //If there are multiple content types, and the default template option is selected, then display error message - var selectedTemplateValue = $('input:radio[name=selectedTemplate]:checked').val(); - if(selectedTemplateValue == "default") { - validationErrorMsg += pageManagementUtils.multipleContentWithDefaultTemplateError; + if(pageContentSections.length > 1) { + var selectedTemplateValue = $('input:radio[name=selectedTemplate]:checked').val(); + if(selectedTemplateValue == "default") { + validationErrorMsg += pageManagementUtils.multipleContentWithDefaultTemplateError + "
"; + } } //For each, based on type, validate if a validation function exists $.each(pageContentSections, function(i) {