On Tue, Jul 15, 2008 at 10:30 AM, Bobby Roberts <[EMAIL PROTECTED]> wrote:
> I've got an IntegerField setup with a max_value of 200000.  I'm
> wondering how to limit the initial input on the form field to no more
> than 6 characters.

You can pass the fields widget an optional attrs keyword argument (a
dictionary) for HTML attributes of the widget.  The HTML attribute
you're looking for is maxlength:

  some_field = forms.IntegerField(widget=forms.TextInput(attrs={'maxlength':
6}))


Arien

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to