I have a model form that contains a DecimalField() with max_digits set to 5. How do I display this field this way:
<input type"text" size="5" maxlength="5" />
I have a model form that contains a DecimalField() with max_digits set to 5. How do I display this field this way:
<input type"text" size="5" maxlength="5" />
Like this:
class MyForm(forms.Form):
myfield = forms.CharField(widget=forms.TextInput(attrs={'size':5, 'maxlength':5})
Read the forms documentation.