Re: [web2py] Changing the HTML attribute of fields generated by SQLFORM

2012-09-02 Thread Dadepo Aderemi
Hahaha! mysubmitbutton["_class"] = "*btn btn-primary*" ;) Spot on! Thanks @rochacbruno On Sunday, September 2, 2012 11:45:25 AM UTC-7, rochacbruno wrote: > > Server side DOM. > > An example: > > mysubmitbutton = form.elements('input[type=submit]')[0] > mysubmitbutton["_value"] = "GO" > mysubmi

Re: [web2py] Changing the HTML attribute of fields generated by SQLFORM

2012-09-02 Thread Bruno Rocha
Server side DOM. An example: mysubmitbutton = form.elements('input[type=submit]')[0] mysubmitbutton["_value"] = "GO" mysubmitbutton["_class"] = "btn btn-primary" Other example, if you want to change the class of all "input" objects. inputs = form.elements("input') for input in inputs: input

[web2py] Changing the HTML attribute of fields generated by SQLFORM

2012-09-02 Thread Dadepo Aderemi
Dear All, How would HTML attributes like id, class etc be added to a form generated using the SQLFORM? I know with FORM, you can easily use the attribute name prepended with an underscore "_" to set the properties. How can this be done with SQLFORM? Specifically I am looking at adding an HTML c