I am using django1.3.7 for developing a web application.How to display a datepicker using jquery.I am having jquery datepicker which is working fine with html.The only requirement is i am using model form,so how to render the datepicker is my question.Kindly help me in this problem.


Recommended Answers

To display the datepicker you have to set an id to the input field, you can do it by passing an array of attributes:

datefield = forms.TextInput(attrs={'id': 'datepicker', 'placeholder': 'Click to select'})
datefield.render('field_name', 'Pick up a Date')


Jump to Post

All 2 Replies

good,but late reply.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.