@Pavel
Priklad
// Code for form validation
$("form[name=item]").validate({
rules: {
"title[en_US]": {
required: true,
minlength: 5
},
"description[en_US]": {
required: true,
minlength: 10
},
countryId: {
required: true
},
regionId: {
required: true
},
catId: {
required: true,
digits: true
},
"photos[]": {
accept: "png,gif,jpg,jpeg"
},
contactName: {
required: true,
minlength: 3
},
sPhone: {
required: true,
minlength: 6
},
contactEmail: {
required: true,
email: true
}
},
messages: {
"title[en_US]": {
required: 'Title: this field is required.',
minlength: 'Title: enter at least 5 characters.'
},
"description[en_US]": {
required: 'Description: this field is required.',
minlength: 'Description: enter at least 10 characters.'
},
countryId: {
required: 'Location: select country from location field.'
},
regionId: {
required: 'Location: select region from location field.'
},
catId: 'Category: this field is required.',
"photos[]": {
accept: 'Photo: must be png,gif,jpg,jpeg.'
},
sPhone: {
required: 'Phone: this field is required.',
minlength: 'Phone: enter at least 6 characters.'
},
contactName: {
required: 'Your Name: this field is required.',
minlength: 'Your Name: enter at least 3 characters.'
},
contactEmail: {
required: 'Email: this field is required.',
email: 'Email: invalid format of email address.'
}
},