Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Date Field label doesn't change style on error



The style applied for Error label is not applied to Date Field Label with Pega 7.1.6.

Error Messages

Not Applicable

Steps to Reproduce

1.Set style and required colour for the error Label in Skin rule.
2.Verify if the style is applied to the label in error scenario.

Root Cause

A defect in Pegasystems’ code or rules.


Paste below code in USERWORKFORM:

function findLabelFor(errorElement) {
var errorElemParent = errorElement.parentNode;

var parentTable = errorElement;
while ((parentTable != null) && ((parentTable.tagName != "TABLE") || (parentTable.className.indexOf("textAreaExpandStyle") > -1))) {
parentTable = parentTable.parentNode;

if (errorElement.className == "Radio" || errorElement.className == "autocomplete_input") {
var parentTable = parentTable.parentNode;
while ((parentTable != null) && (parentTable.tagName != "TABLE")) {
parentTable = parentTable.parentNode;

if (!parentTable)
return "";

var labelList = parentTable.getElementsByTagName("LABEL");

var labelForElement = null;

var elemId =;
if (elemId == "EXPAND" && errorElement.tagName.toLowerCase() == "textarea" && errorElement.DisplayedProperty) elemId = errorElement.DisplayedProperty;
for (var el = 0; el < labelList.length; el++) {
labelList[el].htmlFor = labelList[el].htmlFor.substring(labelList[el].htmlFor.indexOf(".") + 1);
if ((labelList[el].htmlFor.toLowerCase() == elemId.toLowerCase()) && (labelList[el].innerText != "")) {
labelForElement = labelList[el];

return labelForElement;

Published May 16, 2017 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us