views:

30

answers:

1

I use the feature of selecting a year with a dropdown. I use it to set birthdays of people at least 18 years old. So far it works perfectly. I have set it up using theseg parameters:

        $('#datepicker').datepicker({
        changeMonth: true,
        changeYear: true,
                    dateFormat: 'dd-mm-yy',
                    minDate: '-100Y',
                    maxDate: '-18Y'
    });

However I'd like to have year navigation. Is it possible to add a next/previous year button?

Thanks in advance for any help!

+1  A: 

Check this : http://jqueryui.com/demos/datepicker/dropdown-month-year.html its part of datepicker plug in

$(function() {
  $('#datepicker').datepicker({
   changeMonth: true,
   changeYear: true
  });
 });
Pranay Rana
Like the code of the op shows that's already in my parameter list which gives me i a working dropdown. However I want buttons added for quickly changing years (like it has for the months).I find having just the year dropdown is not always convenient enough.
Johan
in example there is month and year combo with the previous next button -- what else you want ?
Pranay Rana
The next/prev button navigates by month, not by year.
Johan
than you can go for this plug in : http://www.eyecon.ro/datepicker/ where functionality change by year
Pranay Rana
That's exactly what I had in mind! Thanks a bunch!
Johan
@Johan - accept ans if it works for you
Pranay Rana