mandag 21. desember 2015 16.12.14 UTC+1 skrev Anthony følgende:
>
> I was hoping I could avoid redirect. Have to redirect to self then, and 
>> then keep output from form1 in session, so than could be used as input in 
>> form2.
>>
>
> There's no reason to redirect to self. Just store what is needed from 
> form1 in the session and proceed with the code for form2. You only need a 
> redirect if the forms will be handled via different actions.
>
> Anthony
>

Hi, 

did not think at first.. 

but, after a bit thoght of what you wrote - it'sworking.

Code:

def test():
    form1 = FORM(
                INPUT(_id = 'foo', _name = 'foo'),
                INPUT(_type='submit', _value="submit")
            )
    
    form1_vars = False
    form2_vars = False
    form2 = False
    e = {}
    if form1.process(formname="form_one").accepted:
        session.form2 = FORM(INPUT(_id = '0', _name = '0'),
                            INPUT(_id = '1', _name = '1'),
                            INPUT(_id = '2', _name = '2'),
                            INPUT(_type='submit', _value="submit"))
    if session.form2:
        form2 = session.form2
        if form2.process(formname = "form_two").accepted:
            form2_vars = form2.vars
    return locals() 

Thx for your help !!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to