openwebwork / webwork2

Course management front end for WeBWorK
http://webwork.maa.org/wiki/Main_Page
Other
141 stars 164 forks source link

Add pattern validation to the email address field on the feedback page. #2313

Closed drgrice1 closed 5 months ago

drgrice1 commented 5 months ago

Also add some other attributes to the field that are useful for such a field (placeholder, autocorrect: off, and autocapitalization: off), and make the field of type "email" instead of "text" to begin with.

It also wouldn't hurt to add server side validation of this fields contents in case an email saved for the user in the database is not valid, but that is not done yet here.

This addresses issue #2312.

somiaj commented 5 months ago

I was looking at this when I saw your PR, and added a PR to your branch with server side validation if you want to add that as well.

One thing I learned from this is email address can have way more characters in them that I would have initially thought.

drgrice1 commented 5 months ago

This now includes server side validation as well. Thanks @somiaj.

somiaj commented 5 months ago

Note, to test the server side validation, you can either enter in a bad email address for your user in the accounts manager, or remove the pattern="..." from the from input box via a web browser's development tools (inspect).