Thanks, Massimo, that's good to know. In my case, form[1] is the form and form[0] is a dynamically generated H3 element that gets inserted when the form is built. I could (and probably should) move that to the view instead of having it buried in a function called by the controller. No wonder I couldn't match what I was seeing in the form to what's shown in the topic entitled "Low Level Access to the Form Tree" in the online book.
Mike On Jun 5, 6:23 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > This will remain backward compatible but can also use (since 1.79.1) > > {{=form.custom.begin}} > {{=form.custom.submit}} > {{=form.element('form')}} # use jquery syntax to select element > {{=form.custom.end}} > > Not sure what form[1] is since it should not exist unless you appended > something to the form. > > On Jun 5, 4:32 pm, MikeEllis <michael.f.el...@gmail.com> wrote: > > > > > Is there a recommended way to control the location of the submit > > button? I've got an app that dynamically generates lengthy forms with > > SQLFORM.factory(). To make things easier for the user, I've arranged > > it so that in many cases the user will only need to fill in one or two > > items at the top of the form. It's nice to have a submit button at > > the top to prevent having to scroll to the bottom. I'm currently > > explicitly inserting form.custom.submit, e.g. > > > {{=form.custom.begin}} > > {{=form.custom.submit}} > > {{=form[0]}} > > {{=form[1]}} > > {{=form.custom.end}} > > > That puts a submit button at the top of the form and it seems to work > > correctly, but I'm not all that comfortable with making numerical > > index references to items in the form unless that's one of the things > > that's guaranteed to remain backwards compatible. > > > Thanks, > > Mike