News for hackers. Stuff that matters.
Re:Gmail password first character is case insensitive on mob... by zbuf on Saturday October 09, 2021 @09:31AM (#28809704)
I thought the same, and was surprised to find the problem here seems to be that there's no part of the HTML spec to set the allowable characters in a text input.

So JavaScript to intercept keypresses or postprocess the string is risky at best and often poorly implemented.

If it was in HTML it could be reliable, and have a unified behaviour when text is pasted in.

For phone numbers there is a "tel" input, so the undesirable behaviour your experiencing may be in spite or because of it.

Re:Gmail password first character is case insensitive on mob... by ourcat on Saturday October 09, 2021 @10:05AM (#28809941)
Doesn't the HTML input `pattern` attribute help solve this with a RegEx?
Re:Gmail password first character is case insensitive on mob... by zbuf on Saturday October 09, 2021 @07:00PM (#28814117)
I'd need to double check, but I was under the impression that it affects a validation check, but that it didn't actually prevent the input of these characters.
Re:Gmail password first character is case insensitive on mob... by ourcat on Monday October 11, 2021 @12:32PM (#28830123)
You can catch the 'invalidity' of the input with the `oninvalid` JS event, then use that to `e.preventDefault()` and show a message as to why it it failed.
Re:Gmail password first character is case insensitive on mob... by zbuf on Friday October 15, 2021 @04:58PM (#28883069)
Interesting... I'll investigate this. Thanks!