How can I restrict users from picking a date that is earlier than another date picker field?

  • Profile Image
    Asked on October 06, 2017 at 01:34 AM

    I have 2 date fields created by the using the date picker widget. 

    I have called them 'valid from' and 'valid to'.

    Need to place a validation that valid to cannot be less than valid from or vice versa. 

  • Profile Image
    Answered on October 06, 2017 at 04:13 AM

    Instead of using 2 separate Date Picker fields, I think the Dates Difference Widget will work better for your needs.

    By default, the widget wouldn't allow users to pick a date that is earlier than the first date.


    Related guide: How-to-Add-a-Widget-to-your-Form

    Please give it a whirl and let us know if you'd need more help.