I have two parts of a question. First I have several dates in my app which aren''t required, so I don''t think I can use a date_select right? There doesn''t seem to be a way to give the user an option to *not* select a date. So, assuming I need to just give the users a form field, anyone have a good piece of code for checking the validity of a date, allowing various forms, i.e.: 12.12.2007 12/12/2007 12-12-2007 Any suggestions? Thanks, Joe. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
jjathman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> I have two parts of a question. First I have several dates in my app > which aren''t required, so I don''t think I can use a date_select right? > There doesn''t seem to be a way to give the user an option to *not* > select a date. > > So, assuming I need to just give the users a form field, anyone have a > good piece of code for checking the validity of a date, allowing > various forms, i.e.: > 12.12.2007 > 12/12/2007 > 12-12-2007 > > Any suggestions? > > Thanks, Joe.No No No :) use some javascript to enable or to disable that date select with a check box for example, and then use the check box value in the controller in order to check if to use the date select value or not. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
jjathman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> I have two parts of a question. First I have several dates in my app > which aren''t required, so I don''t think I can use a date_select right? > There doesn''t seem to be a way to give the user an option to *not* > select a date. > > So, assuming I need to just give the users a form field, anyone have a > good piece of code for checking the validity of a date, allowing > various forms, i.e.: > 12.12.2007 > 12/12/2007 > 12-12-2007 > > Any suggestions? > > Thanks, Joe.try this plugin for validation http://svn.viney.net.nz/things/rails/plugins/validates_date_time/ -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---