I think that the problem when doing fields=[] is that it tells web2py
to build a field-less form which has no meaning so far. gluon API
says: "...a list of fields that should be placed in the form...".
Instead, it's probably best to just use the db.table.field.readable
attribute

On 26 mar, 07:46, Alan Etkin <[email protected]> wrote:
> Is the buttons parameter documented somewhere?, I don't recall having
> seen it.
>
> Fields that have a readable attribute set to False cannot be seen:
>
> db.to_be_lawyer.name.readable = False
> ...
>
> The fields parameter of SQLFORM defaults to all, but passing an empty
> sequence should prevent all fields to show.
>
> On 26 mar, 07:31, web2py_lover <[email protected]> wrote:
>
>
>
>
>
>
>
> > How to hide all fields of SQLFORM with submit button only?
>
> > all fields of  db.to_be_lawyer are  'name' and 'age'.
>
> > I try
> >         db.to_be_lawyer.name.default = 'default name'
> >         db.to_be_lawyer.age.default = '28'
> >         form_to_be_lawyer= SQLFORM(db.to_be_lawyer, fields=[], buttons
> > = [INPUT(_type='submit',_value="apply to be a lawyer")] )
>
> > but fail.

Reply via email to