Stephan Richter a écrit :
On Thursday 07 February 2008, Christophe Combelles wrote:
Maybe the best way to have a password validation would be to let the
PasswordWidget display two password fields and check itself the values are
the same?


Bingo. :-) I Would implement a PasswordConfirmationWidget. Then you have a special converter that throws an error, if the passwords do not match.

I have written a very basic confirmation with only javascript, that does not enforce password equality but just warns the user, and that should be sufficient in most case. This is a template that just has to be registered for PasswordWidget, without implementing a new widget:
http://kelpi.com/script/10992d

<z3c:widgetTemplate
    template="password_input.pt"
    mode="input"
    layer="myapp.interfaces.IMyLayer"
    widget="z3c.form.browser.password.PasswordWidget" />

If a PasswordConfirmationWidget was implemented, the javascript code should probably be moved into the widget view class.

Christophe


Regards,
Stephan

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to