我希望這個條件能夠填寫驗證表格的輸入
P粉908643611
P粉908643611 2023-09-11 18:09:07
0
1
433

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;
  }
};

我希望這個條件能夠用來填寫驗證表單的輸入,我認為這是不可能解決的問題,請幫幫我!

P粉908643611
P粉908643611

全部回覆(1)
P粉738248522

雷雷
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!