How are you creating the form?

Crud, form, sqlform, custom or html?

http://zerp.ly/rochacbruno
Em 29/09/2011 15:23, "jkral" <jk...@gogoair.com> escreveu:
> I am having some troubles getting my form to error when no items are
> selected in the environment field.
> Could someone please shed some insight? and I apologize in advance if
> this request is redundant.
>
>
> from <specific module> import ENVIRONMENTS
> ##ENVIRONMENTS is a tuple
>
> db.define_table('info',
> Field('info_number', 'integer', label='Info Number'),
> Field('description', 'text'),
> Field('environment', widget=SQLFORM.widgets.checkboxes.widget),
> Field('notice'))
>
> db.info.environment.requires = IS_IN_SET(ENVIRONMENTS, multiple=True,
> error_message='Please select appropriate environment(s).')
>
> The other fields error (if empty) based on their respective validators
> this is what I want for the environment field, but it returns an empty
> []
>
> Also please note that I did receive an error_message before I added
> multiple=True.
>
> I have tried:
>
> db.info.environment.requires = [IS_NOT_EMPTY(),
> IS_IN_SET(ENVIRONMENTS, multiple=True, error_message='Please select
> appropriate environment(s).')]
>
> but no avail
>

Reply via email to