Yes, I know this thread has bounced around here before. But I'm still
stuck ...

I'm building a custom registration page. I think I'm getting hung up
on the password_two field, like everyone else.

Here's my code:

#controller
def register():
 
db.auth_user.first_name.readable=db.auth_user.first_name.writable=False
 
db.auth_user.last_name.readable=db.auth_user.last_name.writable=False
  db.auth_user.country.readable=db.auth_user.country.writable=False
  db.auth_user.tzone.readable=db.auth_user.tzone.writable=False
  db.auth_user.zipcode.readable=db.auth_user.zipcode.writable=False
  return dict(form=auth.register()

#view
{{extend 'layout.html'}}
{{TOS='blah blah blah'}}
{{=DIV(
  form.custom.begin,
  H2(T('Create An Account')),HR(),
  FIELDSET(
    LABEL(form.custom.label['email']),
    form.custom.widget.email,
    BR(),
    T('Must be a valid email -- we will send an account activation
message to this address')
    ),
  FIELDSET(
    LABEL(form.custom.label['password']),
    form.custom.widget.password,
    ),
  FIELDSET(
    LABEL(T('Verify password')),
    INPUT(_type='password',name='password_two',_id='password_two'),
    ),
  FIELDSET(
    LABEL(T('Terms Of Service')),
    TEXTAREA(TOS),
    ),
  DIV(
    T('By clicking the "Register" button below you acknowledge that
you have read and accepted the Terms Of Service.'),
    ),
  BR(),
  DIV(auth.settings.captcha),
  BR(),
 
INPUT(_type='submit',_name='register',_value='Register',_class='button'),
  form.custom.end,
  _class='register-form',
  )
}}


Problem: whether passwords are the same or different has no effect on
outcome ... user is redirected to registration page and no error pop-
up appears.

I'm sure by now that someone has posted an example of a custom
registration form using password and password_two. Can someone point
me in the right direction, please?

Reply via email to