From 68e2cd7a58ffb18db019be14213e6352c5e52a47 Mon Sep 17 00:00:00 2001 From: hjkhjk54 Date: Tue, 22 Nov 2011 21:40:59 +0000 Subject: [PATCH] Updating to allow addAuthorsToInformation and other custom forms to detect validation errors combined at top of page(method updated was findValidationErrors) --- webapp/web/js/customFormUtils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/web/js/customFormUtils.js b/webapp/web/js/customFormUtils.js index 91a2a85be..0f10633a3 100644 --- a/webapp/web/js/customFormUtils.js +++ b/webapp/web/js/customFormUtils.js @@ -41,8 +41,12 @@ vitro.customFormUtils = { }, // Return true iff there are validation errors on the form + //Updating to include new functionality where errors are on top of page findValidationErrors: function() { - + var validationErrorSection = $('#error-alert'); + if(validationErrorSection.length > 0) { + return true; + } return this.form.find('.validationError').length > 0; // RY For now, we just need to look for the presence of the error elements.