uhm .... the red parts must be equal

def first():
    form = SQLFORM.factory(Field('
visitor_name', requires=IS_NOT_EMPTY()))
    if form.process().accepted:
        name = form.vars.visitor_name
        redirect(URL('second',vars=dict(name=name)))
    return dict(form=form)

def second():
     name = request.vars.visitor_name or redirect(URL('first'))
     return dict(name=name)

if you change "second" to

def second():
     name = request.vars.name or redirect(URL('first'))
     return dict(name=name)

it should work.

On Friday, June 14, 2013 10:54:40 PM UTC+2, samuel bonilla wrote:
>
> hi all, i'm from colombia, I do not speak English... this is a translater 
> of google... translate.google.com.co
>
> when I insert my name on the form do not nothing
> why in the second view .... name = request.vars.visitor_name or 
> redirect(URL('first')) return None ???
>
> def first():
>     form = SQLFORM.factory(Field('visitor_name', requires=IS_NOT_EMPTY()))
>     if form.process().accepted:
>         name = form.vars.visitor_name
>         redirect(URL('second',vars=dict(name=name)))
>     return dict(form=form)
>
> def second():
>      name = request.vars.visitor_name or redirect(URL('first'))
>      return dict(name=name)
>
> vews...
>
> first.html
>
> {{extend 'layout.html'}}
>
> {{=form}}
>
>
> second.html
>
> {{extend 'layout.html'}}
>
> <span> hola <strong>{{=name}}</strong> </span>
>
>

-- 

--- 
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