Yannick
unread,Jun 20, 2009, 3:50:27 PM6/20/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py Web Framework, Massimo Di Pierro
Hello mate,
I'm using the latest version 1.64.3 and some of my application
functionality that used to work before is not working anymore... I did
a routine testing on one of the page that contains multiple form here
is a sample of how I used to implement it with previous version of
Web2py....
@auth.requires_login() :
def pwdSetting(): return dict(chg_pwd = auth.change_password())
@auth.requires_login() :
from gluon.sqlhtml import form_factory
settingform = form_factory(
SQLField('firstname',label='First Name',
requires=IS_NOT_EMPTY
(),default=default_firstname),
..... )
if form.accepts(request.vars, session, keepvalues=True,
formname='settingform'):
# Some code
return dict(formsetting=settingform)
@auth.requires_login()
def index():
profileSet = profileSetting()
pwdSetting = pwdSetting()
return dict( profileSet=profileSet, pwdSet=pwdSetting)
###########
In the View "Index.html"
############
Profile Setting:
<form action="" enctype="multipart/form-data" method="post">
First Name:
<input name="firstname" type="text"
value="{{=profileSet["formsetting"].latest.firstname}}"/>
.....
<input type="submit" value="Submit" />
{{=profileSet["formsetting"].hidden_fields()}}
</form>
Password Setting:
<h1> Password Setting </h1>
<form action="" enctype="multipart/form-data" method="post">
Old Password:
<input name="old_password" type="password" value="" />
New Password:
...
...
<input type="submit" value="Submit" />
{{=pwdSet["chg_pwd"].hidden_fields()}}
</form>
Now using this code I can't save, the validation is not successful...
Did anyone of you had the same problem ?
Thanks for your help...
Cheers,
Yannick P.