1

I have requirement to add DOB field in Sitecore Forms in version 10.0. Is there any OOTB field that can be used for this. I see Date field is there but it is allowing current/future date selection also.

Kindly suggest what can be best OOTB option here.

1 Answer 1

3

There is no OOTB field for DOB field in Sitecore form. You can have two options here.

  1. If you install Sitecore Form Extension then you will get future date, past date and minimum age 18 validator with the package. As given in below image.

enter image description here

Refer to this link for more details.

  1. Another option is to create custom validator to create a validation like this.

Refer to this Sitecore Document to know how to create a custom validator.

https://doc.sitecore.com/xp/en/developers/90/sitecore-experience-manager/walkthrough--creating-a-custom-validator-based-on-the-existing-regular-expression-validation.html

Hope this helps.

2
  • Thanks. Is there way to style the calendar coming from Date field ?
    – Uday
    Sep 11, 2023 at 10:50
  • Yes if you click on the DateField in the Sitecore Form Panel, you will find a field called CSS class, Write your class and it will render with control and then you can write CSS. Sep 11, 2023 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.