I'm adding a field via jquery on a form, tried to add manually the validation and the required tag. But when i click on the field it doesn't show the validation message under the input.
var fieldToAdd='<div class="col-md-12"> ' +
'<input class="form-control col-md-10" data-val="true" data-
val-required="Le champ Destination est requis." id="' +
personalID + '" name="' + personalID + '" type="text"
value="">' ;
$(".destinationMultiple").append(fieldToAdd);
$("#" + personalID).rules('add', {
required: true,
messages: {
required:"Ce champ est important"
}
})
Edit: It does put the red style surrounding the input in red but not the message under it