Date range validations on Date Field

Krisgum 26-05-2016

Hi  ,

  I'm trying to resolve a use case , where i need to apply date range validations and also provide options for date offsets ex : currentDate+20 ..

The current OOTB date picker component do not provide such configurations , though native html 5 date has min and max date range attributes to support . 

  I'm currently considering an approach to extend current dateTime xfa widget  and in render method hook jqueryUI date picker . But with this approach iIm not sure how to actually show error message to end user on validation  . Are there any standard methods like render that can be overidden in the widget to show custom error messages ? 

If not any other easy approached to handle this use case ? 

Mark Solution

Are these answers useful?
Help other community members by marking useful answers as accepted.

Accepted Solutions (0)

Answers (1)

Answers (1)

gauravahuja11 08-12-2016

Hi,

For adding maximum and minimum support for a component, you can add a validation script on that component using the rule editor.

I've attached a screenshot for the script on a text field for a maximum value - 20 and minimum value - 10

The documentation for rule editor is available at - https://helpx.adobe.com/aem-forms/6-1/rule-editor.html