我在网上发现了一个脚本并且我编辑了它以适合我的文本字段,但是在我的代码编辑器中它突出显示了最后一行但语法错误。因为我是jquery代码的新手,我很难解决它
$(document).ready(function () {
$('#form_reigs').validate({ // initialize the plugin
rules: {
firstname: {
required: true,
},
lastname: {
required: true,
minlength: 5
},
email2: {
required: true,
email: true
},
password2: {
required: true,
minlength: 5
},
password23: {
required: true,
minlength: 5
}
},
messages :{
"firstname" : {
required : 'Please enter your firstname',
"lastname" : {
required : 'Please enter your lastname',
"password2" : {
required : 'Please enter your password',
"password23" : {
required : 'Please re-type your password',
}
}
});
});
任何帮助
答案 0 :(得分:0)
messages
$(document).ready(function () {
$('#form_reigs').validate({ // initialize the plugin
rules: {
firstname: {
required: true,
},
lastname: {
required: true,
minlength: 5
},
email2: {
required: true,
email: true
},
password2: {
required: true,
minlength: 5
},
password23: {
required: true,
minlength: 5
}
},
messages: {
"firstname": {
required: 'Please enter your firstname',
},
"lastname": {
required: 'Please enter your lastname',
},
"password2": {
required: 'Please enter your password',
},
"password23": {
required: 'Please re-type your password',
}
}
});
});