📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
b2be-ticaretscripti.demodesign.com.tr
/
boss
/
datas
/
js
/
two-factor
📝
factor-custom.js
← Geri Dön
const inputElements = [...document.querySelectorAll("input.code-input")]; (function () { inputElements.forEach((ele, index) => { ele.addEventListener("keydown", (e) => { // if the keycode is backspace & the current field is empty // focus the input before the current. Then the event happens // which will clear the "before" input box. if (e.keyCode === 8 && e.target.value === "") inputElements[Math.max(0, index - 1)].focus(); }); ele.addEventListener("input", (e) => { // take the first character of the input // this actually breaks if you input an emoji like 👨👩👧👦.... // but I'm willing to overlook insane security code practices. const [first, ...rest] = e.target.value; e.target.value = first ?? ""; // first will be undefined when backspace was entered, so set the input to "" const lastInputBox = index === inputElements.length - 1; const didInsertContent = first !== undefined; if (didInsertContent && !lastInputBox) { // continue to input the rest of the string inputElements[index + 1].focus(); inputElements[index + 1].value = rest.join(""); inputElements[index + 1].dispatchEvent(new Event("input")); } }); }); // mini example on how to pull the data on submit of the form function onSubmit(e) { e.preventDefault(); const code = inputElements.map(({ value }) => value).join(""); console.log(code); } })();
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula