2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
27 <script type="text/javascript">
29 var $form = $('form.{/literal}{$form.formClass}{literal}');
30 $('#postal_greeting_id, #addressee_id, #email_greeting_id', $form).change(function() {
31 var fldName = $(this).attr('id');
32 if ($(this).val() == 4) {
33 $("#greetings1, #greetings2", $form).show();
34 $("#" + fldName + "_html, #" + fldName + "_label", $form).show();
36 $("#" + fldName + "_html, #" + fldName + "_label", $form).hide();
37 $("#" + fldName.slice(0, -3) + "_custom", $form).val('');
41 $('.replace-plain[data-id]', $form).click(function() {
42 var element = $(this).data('id');
44 $('#' + element, $form).show();
45 var fldName = '#' + element + '_id';
46 if ($(fldName, $form).val() == 4) {
47 $("#greetings1, #greetings2", $form).show();
48 $(fldName + "_html, " + fldName + "_label", $form).show();