Attempting to set the tabIndex for date_select has proven to be difficult out of the box.
<%= f.date_select :card_expires_on,
{:order => [:month, :year], :discard_day => true, :start_year => Date.today.year,
:end_year => (Date.today.year+10), :add_month_numbers => true},
{:tabindex => "11"} %>
That is the best I've come up with, but that sets the tabIndex to be 11 for both of the select dropdowns. How do I set the tabIndex of the month to 11 and the tabIndex of the year to 12?
You can't with the standard date_select
helper, all of the html options get passed to the DateTimeSelector
class, which creates drop downs for each field with these html options.
You could modify this class to do what you need (see date_helper.rb in action pack if rails3) or you could write your own date_select that does this etc.