The rules work and the messages don't work
Hello,
I have a problem with the validation messages in jQuery. I have a dynamic form, I put rules (rules) for field 'tel_m' and it works well for all the fields (dynamic). Now I would write 'messages', the problem is that the validation does not work very well: it is enough for me to write a single field correctly (not vacuum telling figures) and the form is submitted WITHOUT than other fields are valid. Where is the mistake?
EDIT:
- $ ('input.comment'). each (function () {
$ (this) .rules ("add"
{
required: true,
digits: true,
messages {
required: "Please enter a phone number",
digits: "Please enter numbers",
}
});
});
Entire code here: http://plnkr.co/edit/QmfKEsZSo8vsKcA1k4V8?p=preview
Please help me