Problem/Motivation

Improve User Experience when the user enters an email on an email element of a Webform.
If the user accidentally adds a space at the end of his email, he can't validate the form and doesn't see the mistake because it's a space.
It may be useful to automatically remove spaces at the end or beginning of the email address.

This bug has been encountered by Ludovic here.

Steps to reproduce

On Webform 6.0.0-alpha20:
- Create a Webform with an email element
- View your Webform and enter an email with a space like this example : "monemail@hbg.com "
- Submit
- The user is invited to submit a valid email address.
UX email Webform

Proposed resolution

CommentFileSizeAuthor
avif-form-ux-email.png53.65 KByepa

Comments

yepa created an issue. See original summary.

jrockowitz’s picture

Status: Active » Closed (won't fix)

This is the default browser behavior for validating email addresses. I don't think the webform module should be altering this behavior. You can add a little custom JS to your page to trim the email element's value.