Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cfinput datefield - how do I create a 30 day limit between two inputs?

Explorer ,
Sep 11, 2008 Sep 11, 2008
I have an ajax cfgrid that has several additional filters bound to it. Two are these are a Start and End date. I would like to limit the date range available 30 days between the Start and End date.

I was originally thinking of limiting the dates a user can select from in the popup calendar, but this creates some usability issues if the user needs to go several months or years.
I think the only way to do this would be write some javascript which prevents the user from doing a search if the date range is > 30 days.

Is there an easy to do this using the built in validation?
512
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 11, 2008 Sep 11, 2008
You have to write your own javascript.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 11, 2008 Sep 11, 2008
That's what I figured. Here's what ended up using:
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 11, 2008 Sep 11, 2008
LATEST
Make sure you test it with a variety of date formats, and some strings that are not dates.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources