Ich möchte, dass diese Bedingung die Eingabe des Validierungsformulars ausfüllt
P粉908643611
P粉908643611 2023-09-11 18:09:07
0
1
404

const userinfo = () => { // Trim -- remove spaces username = document.getElementById("username").value.trim(); email = document.getElementById("email").value.trim(); password = document.getElementById("password").value.trim(); confirmpassword = document.getElementById("confirmpassword").value.trim(); console.log(username, email, password, confirmpassword); };
const checkinput = () => { // Not Null if ( username.trim().length !== 0 && email.trim().length !== 0 && password.trim().length !== 0 && confirmpassword.trim().length !== 0 ) { return true; } else { // Style Java // Element.style.typeof style(Border, Size, Font, Color) msgPassword.style.border = "2px solid red"; msgConfirm.style.border = "2px solid red"; document.getElementById("error-allength").innerHTML = "place fill all filed "; return false; } };

Ich möchte, dass diese Bedingung verwendet wird, um die Eingabe des Validierungsformulars auszufüllen. Ich denke, es ist unmöglich, das Problem zu lösen. Bitte helfen Sie mir!

P粉908643611
P粉908643611

Antworte allen (1)
P粉738248522

const checkinput = () => { if ( username.trim().length !== 0 || email.trim().length !== 0 || password.trim().length !== 0 || confirmpassword.trim().length !== 0 ) { return true; } else { msgPassword.style.border = "2px solid red"; msgConfirm.style.border = "2px solid red"; document.getElementById("error-allength").innerHTML = "请填写所有字段"; return false; } };
    Neueste Downloads
    Mehr>
    Web-Effekte
    Quellcode der Website
    Website-Materialien
    Frontend-Vorlage
    Über uns Haftungsausschluss Sitemap
    Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!