In Cognito Forms how do I program a warning note to appear on the form if the selected order date is past a certain number of days?

This is for an RMA Form on an eCommerce website.

  • Hi Alex, thanks for contributing your knowledge. The best way to go about sharing this is to make this question body into an actual question and then answer it in the answer box. That way it fits with the format of the site and it will show up better in Google searches that way as well. Thanks :)
    – jonsca
    Mar 27, 2016 at 0:12
  • Hi jonsca, thanks for the posting advise. This is my first post on Stack Exchange and I knew my comment was an answer instead of a question however I did not realize how to get around that. Do you think I should edit my post to fit the format of the site like you described?
    – Alex
    Mar 29, 2016 at 20:11
  • Yes, please. It would be very helpful to those running into this in the future
    – jonsca
    Mar 29, 2016 at 22:31

1 Answer 1


To show a warning note on a return merchandise authorization (RMA) form that only appears if the order was placed after the store's time limit for returns is, add a Date input field to the form and label it "Date of Purchase", then in the Date Field's Show Custom Error setting select "When" and add the following Custom Expression:


The -30 in the custom expression can be changed to any number of days that you want, such as -90 for 3 months or -365 for one year.

Then add whatever text you want to the Custom Error's error message such as "Returns are only accepted within 30 days after the item was purchased. Unfortunately if you submit this form your return will be denied."

Also in the Date Field Setting's "Range" setting you can leave the minimum value blank and type "Today" into the maximum setting so dates after today can not be accidentally selected.

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.