I've done that, and it's not hard, but there's quite a few good js datepickers out there, and on my most recent one I used one of those.... gives me a bit more control over how I want it to look on the public-facing part, and I'm not making 5 http calls to do it.
Here's the one I went with: http://www.frequency-decoder.com/demo/date-picker-v2/ And again, it's just adding a class to the input. On Aug 7, 5:45 pm, Noam <[EMAIL PROTECTED]> wrote: > Hello, > > I wanted to add a javascript calendar (like the one you have in > Django's admin) to a date textbox in a form. > I found this post, which says how to do > it:http://groups.google.com/group/django-users/browse_frm/thread/3328829... > > I thought I might share with you how I did it - I think that it's > simpler than what's described there. > > To add the calendar, you only need to: > > 1. Make sure that the admin interface is enabled. > 2. Add this to the <head> element in your HTML template: > > <link rel="stylesheet" type="text/css" href="/media/css/widgets.css" / > > <script type="text/javascript" src="/admin/jsi18n/"></script> > <script type="text/javascript" src="/media/js/core.js"></script> > <script type="text/javascript" src="/media/js/calendar.js"></script> > <script type="text/javascript" src="/media/js/admin/ > DateTimeShortcuts.js"></script> > > Note that this assumes that your admin media sits in "/media". If it's > not the case, you need to replace "/media" with your admin media path. > > 3. Add an attribute class="vDateField" to your <input type="text"> > element. > If you're using the newforms library, you can do it by using a line > like this in your form definition: > date = > forms.DateField(widget=forms.TextInput(attrs={'class':"vDateField"})) > > Have a good day, > Noam --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---