News for hackers. Stuff that matters.
Re:HTML Form Validation is heavily underused by mattgreenrocks on Monday October 28, 2024 @07:50PM (#41977846)
It’s amazing how many login forms are labeled “email” and then don’t have the correct type set.
Re:HTML Form Validation is heavily underused by _heimdall on Tuesday October 29, 2024 @12:59AM (#41979522)
This is particularly annoying on mobile since on-screen keyboards won't adjust to an email input layout and autocorrect will screw up basically any email address as soon as a "." character triggers autocomplete to commit it's guess.
Re:HTML Form Validation is heavily underused by icar on Tuesday October 29, 2024 @02:54AM (#41980128)
And password managers will not fill in the credentials correctly.
Re:HTML Form Validation is heavily underused by Sander_Marechal on Tuesday October 29, 2024 @05:09AM (#41981167)
Get a better password manager? I use Bitwarden and it has never failed to fill out the login forms for me.
Re:HTML Form Validation is heavily underused by crabmusket on Tuesday October 29, 2024 @06:14AM (#41981995)
Bitwarden has failed me on some sites.
Re:HTML Form Validation is heavily underused by crabmusket on Tuesday October 29, 2024 @06:14AM (#41981989)
I think that in some cases this could be because the inputs accept usernames as well as emails. But not in all cases, which is annoying!
Re:HTML Form Validation is heavily underused by account42 on Tuesday October 29, 2024 @06:52AM (#41982426)
From https://developer.mozilla.org/en-US/docs/Web/HTML/Element/in...

> Browsers automatically provide validation to ensure that only text that matches the standard format for Internet email addresses is entered into the input box. Browsers use an algorithm equivalent to the following regular expression:

> /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;

Which doesn't even allow all valid email addresses :|

No support for quoted local parts. No support for punycode domains. Disappointing.

Use <input type="text" inputmode="email"> instead to just get the email-optimized keyboard on phones without the misguided validation.

Re:HTML Form Validation is heavily underused by friendzis on Tuesday October 29, 2024 @11:08AM (#41984618)
It's not the fact that software engineering is broken saddens me as much as the extent.

Email is older than absolute majority of active developers and yet, it seems, simple knowledge like "what is email address" remains such an arcane knowledge that you are being looked at weird when present something a tiny little bit more correct than the status quo.

Where else can we assume that the common knowledge is flat out wrong?

Re:HTML Form Validation is heavily underused by Akronymus on Tuesday October 29, 2024 @01:20PM (#41986944)
>"what is email address"

Anything you can send an email to that is received, as far as I am concerned. I have my own domain, so why ahould I be forced to add an arbitrarily long string to it to be able to receive the mail? Or exclude <site>@myDomain.com from being input on <site>?

Or the worst of the worst: Disallow all but a few domains for emails.

At this point, not validating it cient side at all is IMO the correct approach, and instead send a verification email.

Re:HTML Form Validation is heavily underused by friendzis on Wednesday October 30, 2024 @02:58AM (#41992434)
> Anything you can send an email to that is received, as far as I am concerned.

100% this.

The only acceptable hard validation is to check whether there is an @ between some characters. something like `.@.` in regex.

It makes sense to do sanity checking (soft validation) on client side. There is 99.9% chance that `[email protected]` is wrong, outright rejecting that is wrong, though.

Re:HTML Form Validation is heavily underused by 85392_school on Tuesday October 29, 2024 @12:59PM (#41986563)
> No support for punycode domains

Really? I tested with a punycode domain on regex101 and it worked fine, do you mean that it only works with ones already converted to punycode?