Skip to content
Snippets Groups Projects
Commit eac283fc authored by Kurund Jalmi's avatar Kurund Jalmi
Browse files

CRM-13078, fixed to show correct icon and to hide error messages

----------------------------------------
* CRM-13078: Batch Data Entry silently drops 'batch-valid' entries if no contact_id is associated with them
  http://issues.civicrm.org/jira/browse/CRM-13078
parent f842cfff
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,7 @@ cj(function () {
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));
});
......@@ -214,10 +214,15 @@ function checkColumns(parentRow) {
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 {
......@@ -225,7 +230,7 @@ function checkColumns(parentRow) {
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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment