[Zope3-Users] select field with Choice widget and formlib
Gary Poster
gary at zope.com
Wed Feb 7 11:46:39 EST 2007
On Feb 7, 2007, at 11:30 AM, Dominique Lederer wrote:
> hi
>
> i render a form with formlib which contains a selectbox:
>
> form_fields = Fields(
> Choice(__name__='selectbox', required=False,
> values=["value1","value2","value3"]),
> )
>
> the rendered output always includes a extra option which contains this
> message-id "vocabulary-missing-single-value-for-edit"
>
> like:
> <option selected="selected" value="">Wert aus Vokabular mit einem Wert
> fehlt</option>
> <option value="value1">value3</option>
> <option value="value2">value3</option>
> <option value="value3">value3</option>
Your field has required=False. How else are you supposed to show, or
allow the choice for, *not* choosing one of your three options?
> how do i get rid of this?
required=True
or write a new widget (a subclass would be easy enough probably)
Gary
More information about the Zope3-users
mailing list