I use JQuery Datepicker and cannot get data from it. In .html:
<p>Date: <input type="text" id="datepicker"/> </p>
In models.py:
class RecordModel(models.Model):
...
Date = models.DateField(blank = False)
...
In forms.py:
class RecordForm(forms.ModelForm):
...
#There is no Date field
...
In views.py:
def doc(request, DocName):
S = request.POST.get("Date") # error
Value of S in doc() function in views.py is "" (empty string), even if I choose date in a widget. How to get real data?
request.POSTbecause the input doesn't havenameattribute specified. I'd suggest attaching the Datepicker to the DateField (or is the problem here thatDatefield of the ModelForm is not being rendered?).$( "#id_Date" ).datepicker();.