Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Bruno Dias
Bruno Dias
10,554 Points

Disable past dates on jQuery Bootstrap datepicker

How do I disable past dates after first date is selected on jQuery Bootstrap datepicker?

I am working on a dynamic form so the page can have 2, 6, 10... datepicker inputs that's why I decided to use class instead of IDs.

This is the closest solution I found however it's still not working properly =(


2 Answers

It's not clear what you want to do - remove ability to change or "detach" event.

detach method is here

and html tag property for readonly below:

<input type="text" name="datepicker" id="datepicker" readonly="readonly">