keep value of email address text fieild after submit form

41 views
Skip to first unread message

Jawad K.

unread,
Oct 10, 2014, 2:46:23 AM10/10/14
to web...@googlegroups.com
Hi,

I am new developer, I have a new web2py app with a login form. I just want to keep value of email address text field after submitting form if username or password is invalid... kindly suggests anything.

Regards,

Jawad K.


Leonel Câmara

unread,
Oct 11, 2014, 3:58:05 AM10/11/14
to web...@googlegroups.com
Hey, right now, this is problematic. See this thread:

Anthony

unread,
Oct 11, 2014, 10:27:57 AM10/11/14
to web...@googlegroups.com
For now, maybe something like:

In a model file:

def login_onfail():
    session
.login_email = request.post_vars.email

auth
.settings.login_onfail.append(login_onfail)

In default.py controller:

def user():
   
if request.args(0) == 'login' and session.login_email:
        db
.auth_user.email.default = session.login_email
       
del session.login_email
   
return dict(form=auth())

Anthony
Reply all
Reply to author
Forward
0 new messages