If you don't want to allow the user to select multiple options, then why is 
the field type list:string rather than just string? If you make it just a 
string type, then you will be able to apply a list of validators, as below.

Anthony

On Tuesday, January 29, 2013 5:39:59 AM UTC-5, Lamps902 wrote:
>
> Thank you for the replies, guys! I think my abstract/trivial example may 
> have obfuscated things a bit. I'm trying to use the IS_IN_SET() validator 
> in combination with a custom validator (yet to be fully written) to make it 
> so that all the elements of a dropdown menu/select are taken from a given 
> set of options (a list of file formats), and for the selected option (file 
> format), the custom validator will make sure the file is in that format. 
> Something like this might be a better description than the initial post:
>
> Field('f_file_format, type='list:string', 
>           
> requires=[IS_IN_SET(theset=list_of_acceptable_options,zero=T('make a 
> selection'), error_message=T(some_error_message)),
>                       CUSTOM_VALIDATOR(request.vars.f_file_format, 
> request.vars.file, error_message=T(some_error_message2))]
>>
>> )
>
> To clarify - I'm not seeking to let the user be able to select multiple 
> options from the drop down list. Maybe it's better to implement the custom 
> validator functionality I'm looking for in the controller, or can it be 
> done in the model? Thank you.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to