Enable jQuery validation for dynamically added input fields

Method 1 : Add rules through JavaScript
// adding rules for inputs with class 'comment'
$('input.comment').each(function() {
  $(this).rules("add", 
  {
    required: true
  })
});

Method 2: Re-apply all rules from data attributes

function resetFormValidator(formId) {
    $(formId).removeData('validator');
    $(formId).removeData('unobtrusiveValidation');
    $.validator.unobtrusive.parse(formId);
}