我有以下代码:
<div class="signup_form">
<form action="#" method="post" id="registratie">
<div class="row-fluid ">
<div class="span12">
<label for="volledige_naam">VOLLEDIGE NAAM</label>
<input type="text" name="volledige_naam" tabindex="1" />
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label for="gebruikersnaam">GEBRUIKERSNAAM</label>
<input type="text" name="gebruikersnaam" tabindex="2" />
</div>
<div class="span6">
<label for="email">E-MAIL</label>
<input type="text" name="email" tabindex="3" />
</div>
</div>
<div class="row-fluid">
<div class="span6">
<label for="wachtwoord1">WACHTWOORD</label>
<input type="password" name="wachtwoord1" tabindex="3" />
</div>
<div class="span6">
<label for="wachtwoord2">HERHAAL WACHTWOORD</label>
<input type="password" name="wachtwoord2" tabindex="4" />
</div>
</div>
</div>
<div class="row-fluid bottompad">
<div class="span2 "> </div>
<div class="span8">
<br>
<br>
<button type="submit" value="Verzenden" name="submit" class="toppad button" style="vertical-align:middle"><span>VERZENDEN </span></button>
</div>
<div class="span2"> </div>
</div>
</form>
javascript是:
<script src="https://code.jquery.com/jquery-3.2.0.min.js" integrity="sha256-JAW99MJVpJBGcbzEuXk4Az05s/XyDdBomFqNlM3ic+I=" crossorigin="anonymous"></script>
<script type="text/javascript">
<!-- https://stackoverflow.com/questions/19823998/jquery-validation-error-validate-is-not-a-function -->
$(document).ready(function () {
$("#registratie").validate({
rules: {
volledige_naam: {
required: true,
rangelenght: [4, 20]
// remote:"look.php"
},
gebruikersnaam: {
required: true,
rangelenght: [4, 20]
},
email: {
required: true,
email: true
},
wachtwoord1: {
required: true,
rangelenght: [4.20]
},
wachtwoord2: {
required: true,
equalTo: "#wachtwoord1"
}
},
messages: {
gebruikersnaam: {
required: "Please enter a username",
minlength: "Your username must consist of at least 3 characters"
},
wachtwoord1: {
required: "Please provide a password",
minlength: "Your password must be at least 5 characters long"
},
wachtwoord2: {
required: "Please provide a password",
minlength: "Your password must be at least 5 characters long",
equalTo: "Please enter the same password as above"
},
email: "Please enter a valid email address"
}
});
});
</script>
我收到错误:
未捕获的TypeError:无法读取属性&#39; nodeType&#39;未定义的
在控制台中。
知道出了什么问题吗?