problem with 2fa factor auto fill with alpine js

hello
2 Replies
NIMA
NIMAOP2mo ago
handlePaste(e) {
let num = e.clipboardData.getData('text/plain').trim();

if (num.length === 6 && num.match(/^[0-9]+$/g)) {
$refs.num1.value = num.charAt(0);
$refs.num2.value = num.charAt(1);
$refs.num3.value = num.charAt(2);
$refs.num4.value = num.charAt(3);
$refs.num5.value = num.charAt(4);
$refs.num6.value = num.charAt(5);
}
},
handlePaste(e) {
let num = e.clipboardData.getData('text/plain').trim();

if (num.length === 6 && num.match(/^[0-9]+$/g)) {
$refs.num1.value = num.charAt(0);
$refs.num2.value = num.charAt(1);
$refs.num3.value = num.charAt(2);
$refs.num4.value = num.charAt(3);
$refs.num5.value = num.charAt(4);
$refs.num6.value = num.charAt(5);
}
},
anyone know what is problem with this code ? it will fill the input but i cant submit it after i copy paste into it
ἔρως
ἔρως2mo ago
none of that code seems relevant unless $refs doesn't exist

Did you find this page helpful?