CRM-12206
authorDeepak Srivastava <deepak.srivastava@webaccess.co.in>
Wed, 3 Apr 2013 11:46:37 +0000 (17:16 +0530)
committerDeepak Srivastava <deepak.srivastava@webaccess.co.in>
Wed, 3 Apr 2013 11:46:37 +0000 (17:16 +0530)
templates/CRM/common/batchCopy.tpl

index 18ecdcf60a5a1b84eafe5b00c521e5e6291a1755..ed3897d7895e5f8d9fa44ba780db602db7657950 100644 (file)
         }
       }
       else {
-        elementId.val( firstElementValue ).change();
+        if (elementId.is('select') === true && firstElement.parent().find(':input').select().index() >= 1) {
+          // its a multiselect case       
+          firstElement.parent().find(':input').select().each( function(count) {
+            var firstElementValue = cj(this).val();
+            var elementId = cj('.crm-copy-fields [name^="field["][name*="[' + fname +'][' + count + '"][type!=hidden]');
+            elementId.val(firstElementValue).not(":first").change();
+          });
+        }
+        else {
+          elementId.val(firstElementValue).change();
+        }
       }
 
     // since we use different display field for date we also need to set it.