Skip to content
Snippets Groups Projects
Commit 591e7c66 authored by Ravish Nair's avatar Ravish Nair
Browse files

-- CRM-12823 included validate.tpl for validation purpose

----------------------------------------
* CRM-12823: "Add" should use same popup as "Edit" in multi-row custom data tables
  http://issues.civicrm.org/jira/browse/CRM-12823
parent 04a0519a
Branches
Tags
No related merge requests found
......@@ -28,13 +28,14 @@
{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">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment