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. custom DateField format widget by Gandalfar 5 years, 2 months ago
  2. Natural language date/time form fields by jdriscoll 4 years, 11 months ago
  3. ActiveManager: filter objects depending on publication and/or expiration dates by haplo 3 years, 10 months ago
  4. Honeypot Field by SmileyChris 5 years, 2 months ago
  5. Pass db.Field to newforms.Widget by guettli 4 years, 10 months ago

Comments

(Forgotten your password?)