[web2py] Re: Form validation on passwords

2012-03-28 Thread Anthony
I tried your code, and it works fine for me. However, the password Testpwd should actually result in an error because the IS_STRONG() validator defaults to number=1 (i.e., at least one number in the password), and you didn't change that default. So, you should get an error on the password

[web2py] Re: Form validation on passwords

2012-03-28 Thread cyan
My view code is fairly minimal, but I suspect it is where the bug lies: {{extend 'layout.html'}} form Email address: input type=text name=email /br / Password: input type=password name=pwd /br / Confirm password: input type=password name=re_pwd /br / input type=submit / /form Do

[web2py] Re: Form validation on passwords

2012-03-28 Thread Anthony
My view code is fairly minimal, but I suspect it is where the bug lies: {{extend 'layout.html'}} form Email address: input type=text name=email /br / Password: input type=password name=pwd /br / Confirm password: input type=password name=re_pwd /br / input type=submit /

[web2py] Re: Form validation on passwords

2012-03-27 Thread Anthony
Here's how auth.register() does it (slightly edited): requires=IS_EXPR('value==%s' % repr(request.vars.get('password', None)), error_message=Password fields don't match) Anthony On Tuesday, March 27, 2012 5:40:29 PM UTC-4, cyan wrote: Hi group, How do I enforce some simple

[web2py] Re: Form validation on passwords

2012-03-27 Thread cyan
Thanks for the pointer. Anthony. So now I have the following in my controller: def register(): form = SQLFORM.factory( Field('email', requires=[IS_NOT_EMPTY(), IS_EMAIL(forced='^.*\.edu(|\..*)$' , error_message='email must be .edu address')]), Field('pwd', requires=[IS_NOT_EMPTY(),