Using only html autocomplete (autocomplete="one-time-code"
) you can autofill inputs using security codes sent by SMS providers.
<input
type="text"
name="auth-token"
inputmode="numeric"
pattern="[0-9]*"
autocomplete="one-time-code"
/>
If you like this article, follow me on Twitter @MaciejDEV
Top comments (2)
Hello! I've added the autocomplete="one-time-code" to my input and my Chrome for Android browser suggests my previous OTP code.
Is "one-time-code" is supported only on iOS, isn't it?
Should I use autocomplete="off" everywhere besides iOS?
👋, to my knowledge it is implemented only on iOS and Mac.