我的代碼看起來像這樣。幫我a-z在jQuery中正則表達式不起作用
$('#form').validate({
errorElement: "span", // contain the error msg in a span tag
errorClass: 'help-block',
ignore: "",
rules: {
CountryName: {
required: true,
regex: /^[a-zA-Z]+$/
}
},
messages: {
CountryName: {
required: "Enter Country name",
regex: "Enter Correct Country name",
},
},
這無關與ASP.Net MVC。據此編輯。 –