On Saturday, March 3, 2012 6:59:40 AM UTC-5, fabien wrote: > > Thanks, SQLFORM.factory() in the controller + form.custom.widget.* in > the view seems to do what I want indeed. The name mislead me into > believing it did even more magic, not less, so I overlooked it. > > I can't figure out how to create submit button widget(s) from > SQLFORM.factory, though. >
With SQLFORM (and .factory), the submit button is added automatically -- you can access the input widget via form.custom.submit. Note, if your form is based on a db table, you should be able to use SQLFORM itself (without .factory). If you need to customize the form object, you can use server-side DOM manipulation (http://web2py.com/books/default/chapter/29/5#Server-side-DOM-and-parsing), as form objects are just HTML helpers. For example: http://www.web2pyslices.com/main/slices/take_slice/43, http://web2py.com/books/default/chapter/29/7#Adding-extra-form-elements-to-SQLFORM. You can also hide specific fields by setting their "writable" attribute to False before creating the form in the controller. If you show some code, we might be able to help you simplify what you're doing. Anthony

