Just configured a JQuery datepicker for taking date of birth input. It will show you 100 years to current date. You can’t select date beyond the yesterday date (present date is excluded). You can configure it more according to your needs. But if you just want a simple datepicker, it will work for you.
$(function() { $( "#datepicker" ).datepicker({ dateFormat : 'mm/dd/yy', changeMonth : true, changeYear : true, yearRange: '-100y:c+nn', maxDate: '-1d' }); });
See demo.
You can apply stylesheet of JQuery, on demo you will see calendar with no styles.
Very Good work.
Thanks Kash 🙂 for dropping by.
Why is the year range using the letters “y” and “nn”, I don’t thinks these are valid options following http://api.jqueryui.com/datepicker/#option-yearRange.
I think it should read:
… yearRange: ‘-100:c’ …
to show the last 100 years.
c = current year
nnnn = placeholder for absolute year
+nn or -nn = relative to today’s year
c+nn or c-nn = relative to currently selected year
sweet 🙂 exactly what I needed thx!!
Nice one
Hey I need a little help, I have a page with multiple forms inside multiple tables which is hidden and shown using a drop-down list. So i have this date of birth option in all the 4 forms but the this datepicker is working in only 1st form, would you help me plz I have no xp in javascript
Awesome, very handy. Thank you!
superb one thank you…
Thank you..its very good