cj("#Entry").ajaxSubmit(options);
});
- cj('#crm-container').on('keyup change', '*', function () {
+ cj('#crm-container').on('keyup change', '*.selector-rows', function () {
// validate rows
checkColumns(cj(this));
});
inValidRow++;
}
else {
- if (cj(this).val() && !cj('input[name="primary_contact_select_id[' + rowID + ']"]').val()) {
+ var contactIdElement = cj('input[name="primary_contact_select_id[' + rowID + ']"]');
+ if (cj(this).val() && !contactIdElement.val()) {
inValidRow++;
errorExists = true;
}
+ else if (cj(this).val() && contactIdElement.val()) {
+ // this is hack to remove error span because we are skipping this for autocomplete fields
+ cj(this).next('span.crm-error').remove();
+ }
}
}
else {
inValidRow++;
}
else {
- if (cj(this).hasClass('error') && !cj(this).hasClass('valid')) {
+ if (cj(this).hasClass('error') && (cj(this).hasClass('valid') || cj(this).hasClass('required'))) {
errorExists = true;
}
else {