On 26-Mar-09, at 2:26 PM, NoviceSortOf wrote:
> It would seem natural that there would be a length or size parameter > on something in forms and/or models Charfield to control the html > display of the field length. How a field in a form in Django is rendered is determined by the corresponding widget used for that field. To that end, Django offers a great deal of flexibility when it comes to customising both the look and functionality of form fields. Having said that, I should point out without sounding condescending that one can specify and configure different supported attributes of an HTML form element through the use of the `attrs` attribute supported by Django widgets. For example, to restrict the size of and specify a class for an input field, the following can be used: text = forms.CharField(label="text", max_length=10, widget=forms.TextInput( attrs={'size':'10', 'class':'inputText'})) One can toss in all manners of *supported* HTML attributes in there. -- Ayaz Ahmed Khan An evil mind is a great comfort. --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---