Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 26... Línea 26...
26
    const codeInput = document.querySelector("#id_verificationcode");
26
    const codeInput = document.querySelector("#id_verificationcode");
27
    const codeForm = codeInput.closest("form");
27
    const codeForm = codeInput.closest("form");
28
    const submitButton = codeForm.querySelector("#id_submitbutton");
28
    const submitButton = codeForm.querySelector("#id_submitbutton");
Línea 29... Línea 29...
29
 
29
 
30
    // Event listener for code input field.
30
    // Event listener for code input field.
31
    codeInput.addEventListener('keyup', function() {
31
    codeInput.addEventListener('input', function() {
32
        if (this.value.length >= 6) {
32
        if (this.value.length >= 6) {
33
            // Submits the closes form (parent).
33
            // Submits the closest form (parent) and prevents accidental resubmission.
-
 
34
            codeForm.submit();
-
 
35
            codeInput.readOnly = true;
34
            codeForm.submit();
36
            submitButton.disabled = true;
35
        }
37
        }
Línea 36... Línea 38...
36
    });
38
    });
37
 
39