1

I'm having a problem formatting the form_for helper f.datetime_select in ruby on rails.

What I want to do is only show future dates. I'm already doing the correct validation, but I want to eliminate the confusion of a user having the ability to select a invalid/previous date from the drop down.

For example: If today was February 3rd, 2011 the user should not be able to select February 2nd 2011 or January 24th, 2011.

Is there a way to modify the drop down values?

Thanks for your help in advanced!

rjryn2
  • 11
  • 1
  • 1
    Certainly it should be valid to select January in your example, since I could also select 2012 for the year. It seems that datetime_select is not what you really want, and instead you should probably use a text field with a JavaScript calendar widget that you can customize to only show future dates. – jdl Jan 21 '11 at 05:55
  • Ahh you are right. I guess I was thinking more along the lines of some type of dynamic date selection where if you have a certain year selected then you can only select the dates that would be in the future instead of the past. But thanks for your comment it made me think about it differently. – rjryn2 Jan 21 '11 at 06:13

0 Answers0