Re: [web2py] Re: remove a class from an element in the form

2013-05-10 Thread António Ramos
nice point. :) 2013/5/10 Anthony > Notice it is form.element(), not form.elements(). The first returns the > first matching element -- the second returns a list (even if it contains > only one match). > > Anthony > > On Friday, May 10, 2013 11:40:58 AM UTC-4, Ramos wrote: > >> *Note, form.eleme

Re: [web2py] Re: remove a class from an element in the form

2013-05-10 Thread Anthony
Notice it is form.element(), not form.elements(). The first returns the first matching element -- the second returns a list (even if it contains only one match). Anthony On Friday, May 10, 2013 11:40:58 AM UTC-4, Ramos wrote: > > *Note, form.element() returns the first matching element, so no n

Re: [web2py] Re: remove a class from an element in the form

2013-05-10 Thread António Ramos
*Note, form.element() returns the first matching element, so no need to do form.elements(...)[0].* * * This does not seem true if i remove [0] like this a['_class'] = 'label label-warning' i get the error TypeError: list indices must be integers, not str 2013/5/10 Anthony > Unless you are

[web2py] Re: remove a class from an element in the form

2013-05-10 Thread Anthony
Unless you are using formstyle='bootstrap', web2py does not add any class at all to elements -- instead, the "w2p_fl' class is added to the label's parent element (which is a TD, DIV, or LI, depending on the formstyle). The 'bootstrap' formstyle adds a 'control-label' class directly to the lab