I wonder why the IS_IN_DB() validator doesn't suit your needs.

I have a field day:

Field('day', 'reference cal_day', default=None, required=True, 
requires=IS_IN_DB(db, 'cal_day.id', '%(id)s %(name)s',  zero='Select a day'), 
ondelete='RESTRICT', notnull=True, label='Day *'),

Doesn't zero = '*Whats your place of operations?'* do what you want?


Annet
Op vrijdag 18 september 2020 om 12:41:11 UTC+2 schreef mostwanted:

>
> Is there a way to create a placeholder for a reference field?
> e.g:
> {{
> *Field('place', 'reference locations', label=SPAN('Place of operations'), 
> widget=lambda field, value: SQLFORM.widgets.reference.widget(field, value, 
> _placeholder="Whats your place of operations?"))*
> }}
>
> Regards;
>
> Mostwanted
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3d69119b-4205-4400-bcba-687881a08fe0n%40googlegroups.com.

Reply via email to