Skip to main content
Inspiring
September 11, 2008
Question

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

  • September 11, 2008
  • 2 replies
  • 585 views
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?
    This topic has been closed for replies.

    2 replies

    Inspiring
    September 11, 2008
    Make sure you test it with a variety of date formats, and some strings that are not dates.
    Inspiring
    September 11, 2008
    You have to write your own javascript.
    CoosAuthor
    Inspiring
    September 11, 2008
    That's what I figured. Here's what ended up using: