Add HTML
validation and remove jQuery
validation from registration form
#9244
Labels
Lead: @rebecca-shoptaw
FE: Internationalization, CSS, JS
Priority: 2
Important, as time permits. [managed]
registration
Type: Feature Request
Issue describes a feature or enhancement we'd like to implement. [managed]
Type: Subtask of Epic
A subtask that is part of the work breakdown of an epic issue (see comments). [managed]
Dependency to
epic
#7694. Sub-task of #9205.Describe the problem that you'd like solved
While the new real-time validation for formatting errors added in #2055 shows very helpful errors to the user, it does not actually prevent users from submitting forms with badly formatted inputs.
Proposal & Constraints
While in most cases, this problem could be solved speedily by adding relevant HTML attributes to the inputs, this particular form is generated via the forms library in
form.py
:In the HTML:
openlibrary/openlibrary/templates/account/create.html
Lines 53 to 61 in ca46cbf
In the Python:
openlibrary/openlibrary/plugins/upstream/forms.py
Lines 74 to 82 in ca46cbf
However, luckily it is fairly straightforward to add any desired HTML attributes to the attribute list above, which translate to the correct attributes in the final rendered HTML.
One other issue here, which we also encountered in #8871, is that the jQuery
validate
plugin, called via thevalidate
class in the form, starts adding extra error messages to the email field on key-up.Since the
validate
class has no other effect on the form, as validation is handled byinit_realtime_validation
andforms.py
validators, I propose removing it.Additional context
Stakeholders
@cdrini
The text was updated successfully, but these errors were encountered: