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. Honeypot Field by SmileyChris 6 years, 2 months ago
  2. Convert XHTML-compatible shorttag to HTML-compatible tag. by clamothe 5 years, 1 month ago
  3. Add CSS class template filter by lazerscience 2 years, 7 months ago
  4. Simple Entity Relationship Diagram using GraphViz by bendavis78 4 years, 1 month ago
  5. Natural language date/time form fields by jdriscoll 6 years ago

Comments

(Forgotten your password?)