On Aug 25, 11:47 pm, Gary <gher...@digipen.edu> wrote:
> I'm a experienced Python programmer (15+ years), but mostly new to web
> programming and just several days into my first web2py application.
>
> Several questions have come up:
>
> 1.  On SQLFORM and CRUD forms, is there a way to get a cancel button
> displayed next to the submit buttons?

I usually do something like this:

<script>
jQuery('input[type=submit]').after('<button onclick="document.location=
\'{{=URL('problem',args=form.record.id)}}\';return
false">cancel<button>');
</script>


> 2.  If I want to pre-fill several fields in a form, I know how to do
> it with SQLFORM and an assignment like form.vars.xxx=yyy, but is there
> such a feature for CRUD forms?

Do not do that. user default instead before SQLFORM. For create forms:
db.mytable.byfield.default=yyyy
For update forms:
db.mytable.byfield.update=yyyy

Reply via email to