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

Reply via email to