Hi Arvind,

On Sep 21, 7:11 pm, Arvind <[email protected]> wrote:
> Hello,
>
> i am writing this in my view to show a label
> {{=form.custom.label.name}}
>
> but how can i define this label with custom properties in the
> controller ?

The idea behind form.custom was to be able to use a form designed
outside web2py with the fields coming from it.
Therefore it not designed to work in the controller but in the view.

Basically you create the form first using whatever tool you like and
then take the generated HTML and add web2py template language commands
like {{=form.custom.label.name}} to replace the coded LABEL, as in:

<LABEL FOR='name'>{{=form.custom.label.name}}</LABEL>

Custom only works with SQLFORM (including SQLFORM.factory).

> currently the output shows up as 'None'.

If you are getting None it means you used SQLFORM.factory but never
set the label attribute of the field, e.g.:

Field('txtUserName',label='user name',requires=IS_NOT_EMPTY())

see page 154 (170 in ipaper) of the manual for all the attributes of
Field.

Denes.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to