Commit | Line | Data |
---|---|---|
c4a7c967 | 1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
c4a7c967 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
c4a7c967 | 8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | {*this is included inside a table row*} | |
11 | <td> | |
12 | <span class="crm-age-range"> | |
13 | <span class="crm-age-range-min"> | |
14 | {assign var=minName value=$fieldName|cat:$from} | |
15 | {$form.$minName.label} | |
16 | {$form.$minName.html} | |
17 | </span> | |
18 | <span class="crm-age-range-max"> | |
19 | {assign var=maxName value=$fieldName|cat:$to} | |
20 | {$form.$maxName.label} | |
21 | {$form.$maxName.html} | |
22 | </span> | |
23 | </span> | |
c4a7c967 | 24 | <span class="crm-age-range-asofdate"> |
ac241c34 CW |
25 | {assign var=dateName value=$fieldName|cat:$date} |
26 | {$form.$dateName.label} | |
27 | {$form.$dateName.html} | |
c4a7c967 | 28 | </span> |
29 | {literal} | |
30 | <script type="text/javascript"> | |
ac241c34 CW |
31 | CRM.$(function($) { |
32 | var $form = $('form.{/literal}{$form.formClass}{literal}'); | |
33 | function toggleDate() { | |
34 | $(".crm-age-range-asofdate").toggle(!!($('.crm-age-range-min input', $form).val() || $('.crm-age-range-max input', $form).val())); | |
c4a7c967 | 35 | } |
ac241c34 CW |
36 | $('.crm-age-range input', $form).on('keyup change', toggleDate); |
37 | toggleDate(); | |
38 | }); | |
39 | ||
c4a7c967 | 40 | </script> |
41 | {/literal} | |
42 | </td> |