diff --git a/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl b/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl index 59d09f2c..20beb5b7 100644 --- a/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl +++ b/productMods/templates/freemarker/edit/forms/addGrantRoleToPerson.ftl @@ -8,6 +8,10 @@ <#assign uriValues = editConfiguration.existingUriValues /> <#assign htmlForElements = editConfiguration.pageData.htmlForElements /> <#assign sparqlForAcFilter = editConfiguration.pageData.sparqlForAcFilter /> +<#--If edit submission exists, then retrieve validation errors if they exist--> +<#if editSubmission?has_content && editSubmission.submissionExists = true && editSubmission.validationErrors?has_content> + <#assign submissionErrors = editSubmission.validationErrors/> +#if> <#assign disabledVal = ""/> <#if editMode = "edit"> <#assign disabledVal = "disabled=\"disabled\"" /> @@ -56,20 +60,40 @@
${errorMessage}
+
+ <#--below shows examples of both printing out all error messages and checking the error message for a specific field-->
+ <#list submissionErrors?keys as errorFieldName>
+ <#if errorFieldName == "startField">
+ <#if submissionErrors[errorFieldName]?contains("before")>
+ The Start Year must be earlier than the End Year.
+ <#else>
+ ${submissionErrors[errorFieldName]}
+ #if>
+
+ <#elseif errorFieldName == "endField">
+ <#if submissionErrors[errorFieldName]?contains("after")>
+ The End Year must be later than the Start Year.
+ <#else>
+ ${submissionErrors[errorFieldName]}
+ #if>
+ #if>
+ #list>
+ <#--Checking if Name field is empty-->
+ <#if lvf.submissionErrorExists(editSubmission, "grantLabel")>
+ Please enter or select a value in the Grant Name field.
+ #if>
+
+