HTML表单验证与XMLRequest结合使用,验证不起作用

时间:2019-02-28 23:54:44

标签: javascript html forms validation

所以我有一个HTML表单,标签上有一些验证。一切正常,直到我放置一些JS发送表单数据为止,现在验证不起作用。

</body>

所以,这一切都按计划进行,,必填字段和密码具有正确的格式等。然后,当我添加以下内容时,它停止正常工作。

<form>
  <input id = "username" oninput = "inputFunction(this.id)" class = "inputField" type = "text" placeholder = "Username:" name = "username" minlength = "8" required><p id = "usernameAlreadyTaken"></p>
  <input id = "psw" oninput = "inputFirstPassword(this.id)" type  = "password" class = "inputField" placeholder = "Password:" name = "psw" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters" required>
  <input id = "psw2" oninput = "inputSecondPassword(this.id)" type  = "password" class = "inputField" placeholder = "Retype Password:" name = "psw"><p id = "check"></p>
  <input id = "fullname" oninput = "inputFunction(this.id)" type class = "inputField" = "text" placeholder = "Full Name:" name = "fullname" required>
  <input id = "email" oninput = "inputFunction(this.id)" type class = "inputField" = "email" placeholder = "Email Address:" name = "email" required>
  <input onclick = "registrationSendFunction()" id = "formRegisterSubmit" type = "button" value = "Create Account"  class = "registerSendButton">
</form>

任何帮助都很好,谢谢。

0 个答案:

没有答案