If you want to use the default labels specified in the table definition, you 
can manually remove the colons from the labels via the server-side DOM (see 
http://web2py.com/book/default/chapter/05#Server-side-DOM-and-Parsing). 
Specifically, SQLFORM constructs each label as follows:
 
            label = LABEL(label, colon, _for=field_id,
                          _id=field_id+SQLFORM.ID_LABEL_SUFFIX)
 
 
The colon is the second component of the LABEL element, so you can remove 
all colons as follows:
 
    form=SQLFORM(db.yourtable)
    for label in form.elements('label'):
        label.components = label.components[-2]
 
 
Anthony

On Monday, April 25, 2011 10:06:41 AM UTC-4, rochacbruno wrote:

> On Mon, Apr 25, 2011 at 3:28 AM, Ab... <[email protected]> wrote:
>
>> If there's a workaround other than modifying the core file, I'd like to 
>> know as I'm also facing the same issue.
>>
>
> You can pass your own labels, and the colon will be removed
>
> formm = SQLFORM(db.yourtable, labels= dict(field1='My Field', field2='Other 
> Field'), fields=['field1,'field2'])
>

Reply via email to