`forge_form.html` is very generic and ends up used in lots of places, so I 
would prefer doing it only for the `PasswordChangeBase`/`PasswordChangeForm` 
and `RegistrationForm` forms that need it.  And now that I think about it, I 
think browser validation can do a lot of this for us.  `minlength` and 
`maxlength` attributes can be set on the input fields.  To do this with 
easywidgets `PasswordField` I believe something like this should work: 
```
            ew.PasswordField(
                name='pw',
                label='New Password',
                ...
                attrs=dict(minlength=6, maxlength=30),
                ...

```

Of course that's hardcoded numbers, that would change of course.

Then the browser will do the enforcing when they hit submit.  If we want to 
enforce it even sooner, we could try adding JS to call `checkValidity` or 
`reportValidity` on the fields whenever they change.


---

** [tickets:#7459] Show password requirements on forms**

**Status:** open
**Milestone:** unreleased
**Created:** Wed Jun 11, 2014 03:46 PM UTC by Dave Brondsema
**Last Updated:** Wed Oct 17, 2018 05:19 PM UTC
**Owner:** nobody


It would be helpful to show password requirements (aka min # of chars) on the 
password change form.  And account creation.


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed 
to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.

Reply via email to