$(document).ready(function() { $("#myform").validate({ rules: { AuthorId: { required: true }, IssueId: { required: true, min: 1 }, ItemTypeId: { required: true }, Date: { required: true, DateCorrectFormat: true }, Caption: { required: true, maxlength: 255 }, Description: { maxlength: 255 }, Bonus: { required: true, RangePrice: true }, Price: { required: true, RangePrice: true } }, messages: { AuthorId: { required: "Proszę wybrać autora." }, IssueId: { required: "Proszę wybrać numer wydania. Musisz najpierw wybrać Gazetę.", min: "Prosze wybrać numer wydania. Musisz najpierw wybrać Gazetę." }, ItemTypeId: { required: "Proszę wybrać typ wierszówki." }, Date: { required: "Proszę podać miesiąc" }, Caption: { required: "Proszę podać tytuł wierszówki.", maxlength: "Tytuł jest za długi." }, Description: { maxlength: "Opis jest za długi." }, Bonus: { required: "Proszę wprowadzić bonus do wierszówki." }, Price: { required: "Proszę wprowadzić wycenę wierszówki." } } }); });