-- CRM-12823 included validate.tpl for validation purpose
authorRavish Nair <ravish.nair@webaccess.co.in>
Mon, 1 Jul 2013 14:08:06 +0000 (19:38 +0530)
committerRavish Nair <ravish.nair@webaccess.co.in>
Mon, 1 Jul 2013 14:08:06 +0000 (19:38 +0530)
----------------------------------------
* CRM-12823: "Add" should use same popup as "Edit" in multi-row custom data tables
  http://issues.civicrm.org/jira/browse/CRM-12823

templates/CRM/Profile/Form/Dynamic.tpl

index eeb5a7428bec9ab23c8ad92f71467acd682f2476..e053b37917f233a054fcb836f998350acf7af5c5 100644 (file)
 {if ($context eq 'multiProfileDialog')}
 {literal}
 <script type="text/javascript">
-cj(function() {
+cj(function($) {
+  $('#profile-dialog .crm-container-snippet #Edit').validate(CRM.validate.params);
   var formOptions = {
     beforeSubmit:  proccessMultiRecordForm //pre-submit callback
   };
 
   //binding the callback to snippet profile form
-  cj('.crm-container-snippet #Edit').ajaxForm(formOptions);
+  $('.crm-container-snippet #Edit').ajaxForm(formOptions);
 });
 
 // pre-submit callback
@@ -55,10 +56,7 @@ function proccessMultiRecordForm(formData, jqForm, options) {
 
     //if there is any form error show the dialog
     //else redirect to post url
-    if (cj(response).find('.crm-error').html()) {
-      cj('#profile-dialog').show().html(response);
-    }
-    else {
+    if (!cj(response).find('.crm-error').html()) {
       window.location = '{/literal}{$postUrl}{literal}';
     }
 
@@ -69,6 +67,7 @@ function proccessMultiRecordForm(formData, jqForm, options) {
 }
 </script>
 {/literal}
+{include file="CRM/Form/validate.tpl"}
 {/if}
 {if $deleteRecord}
 <div class="messages status no-popup">