[Zope3-Users] Arranging widgets in a form / Limit size of input fields

Fred Drake fdrake at gmail.com
Wed May 2 09:33:12 EDT 2007

On 5/2/07, Hermann Himmelbauer <dusty at qwer.tk> wrote:
> Moreover I wonder if it's possible to customize the attributes "size"
> and "maxlength" of HTML input fields via the zope schema. Schemas offer the
> attribute "max_length", however this does not affect the rendered HTML - size
> seems to be always set to "20", maxlength is never set.

maxlength is used to control the maximum length of the input, IIRC.
If you're using the standard Text widget, you can control this by
setting the displayMaxWidth attribute on the widget object.

The visual width (the size attribute in the HTML) is controlled using
the displayWidth attribute of the widget object.

With zope.formlib, these can be set in the setUpWidgets() method; be
sure to call the base setUpWidgets() first, then get the widget
objects from self.widgets.


Fred L. Drake, Jr.    <fdrake at gmail.com>
"Chaos is the score upon which reality is written." --Henry Miller

More information about the Zope3-users mailing list