date_select and the bad id

The problem with changing the id, or even adding a class or something is that the date_select helper generates multiple select elements (e.g. year, month, day). Have you considered writing some javascript that can create the appropriate id? The id is created as a concatenation of the model, the field, and the subtype of date/times, and the i character, where subtype values are 1 = year, 2 = month, 3 = day, and so on for others. If you only cared about having the right number of days for a given month (which is deterministic, but don't forget about leap years!), you would only need to know the value of model and field, but that's not really "generic".

So a bigger question is, do you really want the default rails date selectors??? If you really, really do, then you might lobby the author of this patch http://dev.rubyonrails.org/attachment/ticket/9015/date_helper.rb to create a patch -- it seems to address exactly what you are looking for (see line 66 of the code compared to the commented out line before it). In short, the date_select fields don't appear to work like others ... yet.

Have you considered a more user-friendly approach, like using one of several calendar helper plugins, such as Google Code Archive - Long-term storage for Google Code Project Hosting. or http://wiki.rubyonrails.org/rails/pages/Calendar+Helper+Plugin? In addition to ensuring a valid date, they give the user a much nicer interface, in my opinion.

Tom