say you have a field called 'client' you can do:

form.element(_name='client')['_placeholder'] = 'The label for client'

Massimo

On Thursday, 27 November 2014 20:02:36 UTC-6, tahnoon pasha wrote:
>
> I have a series of form elements as follows
>
>     form = SQLFORM.factory (
>         Field ('client',
>                requires=IS_IN_SET 
> (['Client','Rhubarb','Custard','Bogies']),
>                default='Client'),
>         Field ('portfolio',
>                requires=IS_IN_SET (['US Equity','Multi Asset 
> ETF','Portfolio']),
>                default='Portfolio'),
>         Field ('benchmark',
>                requires=IS_IN_SET (['S&P 500','Custom 
> Policy','Benchmark']),
>                default='Benchmark'),
>         Field ('methodology',
>                requires=IS_IN_SET (['Brinson-Fachler', 
> 'Regression','Method']),
>                default='Method'),
>         Field('level1',
>               requires=IS_IN_SET(['Sector','Industry','Asset Class', 
> 'Level 1']),
>               default='Level 1'),
>         Field('level2',
>               requires=IS_IN_SET(['Sector','Industry','Asset Class', 
> 'Level 2']),
>               default='Level 2'),
>         Field ('start_date', 'date', default="Start Date"),
>         Field ('end_date', 'date', default="End Date")
>     ).process ()
>
> I have a slightly fumble fingered approach to set a label inside each form 
> field instead of as a label above or alongside as shown in the code, by 
> setting the label as a default. The page this input form will be used for 
> is a busy one and space is at a premium.
>
> Is there a more elegant way to put form labels into the form field that 
> won't fail on the dates inputs?
>
> As a side question, the approach above displays the default inside the 
> widget for Method, Level 1 and Level 2, but not for client, portfolio and 
> benchmark. Is there something wrong with my code that would cause that?
>
>
> Thanks
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to