我在ASP.Net中遇到jquery验证问题。我不知道为什么。 我有一个表单验证以测试如下:
function ValidateForm() {
$('#testForm').validate(
{
rules: {
<%=txtUsername.UniqueID%> : {
required: true,
minlength: 6
},
<%=txtEmail.UniqueID%> : {
required: true,
email: true
}
},
messages:
{
<%=txtUsername.UniqueID%> : {
required: "Must input username",
minlength: "Max length are 6 charators"
},
<%=txtEmail.UniqueID%> : "Is not email fomat"
}
});
}
这里,jquery验证代码
def primes(limit):
# Just make an empty list where the primes go
prime = []
# This next for loop just adds all the numbers of the form 6n+/-1 to the list, as all primes are of this form
for i in range(1,limit / 6 + 1):
prime.append(6*i - 1)
prime.append(6*i + 1)
# If the limit is divisible by 6, the last number on the list is sometimes over the limit
if limit % 6 == 0 and prime[-1] > limit:
prime.remove(prime[-1])
# This next line just finds the place of the 'square root' of the limit, which is as high as it has to check for factors
squareroot = min(range(len(prime)), key=lambda i: abs(prime[i]-(limit**0.5))) + 1
# Removing composites BELOW the square root
for p in prime[:squareroot][:]:
for f in range(2, int(p ** 0.5) + 1):
if p % f == 0:
prime.remove(p)
break
# Removing composites ABOVE the square root
for f in prime[:squareroot][:]:
for p in prime[squareroot:]:
if p % f == 0:
prime.remove(p)
return [2, 3] + prime
但是,结果与消息不匹配: Click here to show