def add():
    form = SQLFORM.factory(Field('url', 'string'))

    if form.process().accepted:
        mystation = info.station(form.vars.url)
        session.tmpstation = mystation
        redirect(URL('confirm'))
    return dict(form=form)


def confirm():
    ... prepopulating form with vars from vars(session.tmpstation) ...
    form = SQLFORM(db.stations).process(next=URL('populate'), 
message=T("record created"))
    del session.tmpstation
    return dict(form=form)

.... confirm.html
{{extend 'layout.html'}}
{{=form}}
<script>window.onbeforeunload = function() {return "form will lose all 
data";};</script>

is there any way to prevent onbeforeunload if form.submit() is the event 
triggering the "onbeforeunload"?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to