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

Using JS to validate dates where the dates are read incorrectly



Modal popup is configured with Ok and Cancel buttons, and Required and Validate rules on the Date fields. When the Validate rule is not satisfied, the modal popup closes on clicking the Ok button.

Error Messages

Not Applicable

Steps to Reproduce

Configure a modal dialog with Date fields, and with Ok and Cancel buttons.

Root Cause

Instead of customizing the JavaScript code for validation of the Date fields with an alert message, the Edit Validate rule was configured for the Date field and the submission of the modal dialog was disabled when a Edit Validate message was present.


Perform the following local-change:
  1. Provide a property level Validation rule for the Date fields in the modal dialog.
  2. Set the Visibility When condition to the Ok button by fetching the Validation message from the Clipboard.
  3. Disable the Ok button if there is any Validation error message in the modal dialog. 


Published March 21, 2019 - 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