diff --git a/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl b/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl index 47cc3259..515b9538 100644 --- a/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl +++ b/productMods/templates/freemarker/edit/forms/personHasEducationalTraining.ftl @@ -22,6 +22,11 @@ <#assign majorFieldValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "majorField") /> <#assign degreeValue = lvf.getFormFieldValue(editSubmission, editConfiguration, "degree") /> +<#--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> + <#if editMode == "edit"> <#assign titleVerb="Edit"> <#assign submitButtonText="Edit Educational Training"> @@ -45,23 +50,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 Org Type field is empty-->
+ <#if lvf.submissionErrorExists(editSubmission, "orgType")>
+ Please select a value in the Organization Type field.
+ #if>
+ <#--Checking if Org Name field is empty-->
+ <#if lvf.submissionErrorExists(editSubmission, "orgLabel")>
+ Please enter or select a value in the Name field.
+ #if>
+
+