Hi guys,

I need to insert 2 datapicker in a django form.
I have not a form.py file.
My views.py related to the datepicker:

class DatePicker(forms.DateInput):
template_name = 'dkey.html'

class Media:
js = (
'js/jquery.min.js',
'js/jquery-ui.min.js',
)
css = {
'all': (
'css/jquery-ui.css',
)
}

class DateForm(forms.Form):
date = forms.DateField(widget=DatePicker)

and the html page dkey.html

<!------------ Including jQuery Date UI with CSS -------------->
<script src="http://code.jquery.com/jquery-1.10.2.js";></script>
<script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js";>
</script>

<!-- Javascript -->
<script>
$(document).ready(function() {
// Datepicker Popups calender to Choose date.
$(function() {
$("#datepicker").datepicker();
// Pass the user selected date format.
$("#format").change(function() {
$("#datepicker").datepicker("option", "dateFormat", $(this).val());
});
});
});
</script>
....

<p><b>Date:</b></p>
<input type="text" name="selected_date" id="datepicker"/> 
<p><br></p>

but in the html page in the browser I see only a textarea and clicking 
dont't appear the datepicker.
I read other similar questions but no solve..
Can someone to help me?
Thanks.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8646fe89-2c9b-4804-a2dc-2f6a2890cdf5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to