custom css classes for newforms

1
2
3
4
5
6
7
8
calendar_widget = forms.widgets.TextInput(attrs={'class':"vDateField required", 'size':10})

class ERSelectForm(forms.Form):
    """
    Allow for selection of dates
    """
    start_date = forms.DateField(widget=calendar_widget)
    end_date = forms.DateField(widget=calendar_widget)

More like this

  1. Add CSS class template filter by lazerscience 3 years, 5 months ago
  2. Changing the look of newforms as_table with a custom BaseForm by bikeshedder 6 years, 10 months ago
  3. Automatic stripping textual form fields by nail.xx 5 years, 8 months ago
  4. Honeypot Field by SmileyChris 7 years ago
  5. Radio widget with labels after inputs by avsd 1 year, 9 months ago

Comments

(Forgotten your password?)