Calling datepicker from a FormHelper - Using CrispyForms

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Calling datepicker from a FormHelper - Using CrispyForms

I am trying to call my JQuery datepicker from a FormHelper. I just can't find a way to send attributes to JQuery e.g "theme":"dark" etc. This is important for me because i want to define the format type also.

class DeviceFilterFormHelper(FormHelper):

= "Device-search-form"
= "GET"
= True
= True
= Layout(
Div('name', css_class="col-md-6"),
Div('location', css_class="col-md-6"),
Div('phone_number', css_class="col-md-6"),
Div(Field('updated_date', css_class="date-time-picker", // this is field in which i want to call my attrs which i can't find a way to call
'required': True,
'theme': 'dark',
'class': 'date-time-picker',
'data-options': '{"format":"Y-m-d H:i", "timepicker":"true"}'

Submit("submit", ("Search"), css_class="col-md-5"),
="col-8 text-right align-self-center",

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 [hidden email].
To view this discussion on the web visit