14.x uses uses a new prototype and use screencontext. To fix the code you must use
function validate(ScreenContext, errorMessage
"Validation JavaScript" regarding screenContext
Delete ​function validate(FieldContext, attributeValue, changedValue) from the 12.6 JS code and use the following for 14.x:
function validate(ScreenContext, errorMessage)