Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 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 | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | {assign var="customGreeting" value=$n|cat:"_custom"} | |
11 | <span>{$form.$n.html|crmAddClass:big}</span> <span id="{$customGreeting}_html" class="hiddenElement">{$form.$customGreeting.html|crmAddClass:big}</span> | |
12 | ||
13 | <script type="text/javascript"> | |
8838f818 | 14 | var fieldName = {$n|@json_encode}; |
6a488035 TO |
15 | {literal} |
16 | cj( "#" + fieldName ).change( function( ) { | |
17 | var fldName = cj(this).attr( 'id' ); | |
18 | showCustom( fldName, cj(this).val( ) ); | |
19 | }); | |
20 | ||
21 | showCustom( fieldName, cj( "#" + fieldName ).val( ) ); | |
22 | function showCustom( fldName, value ) { | |
23 | if ( value == 4 ) { | |
24 | cj( "#" + fldName + "_custom_html").show( ); | |
25 | } else { | |
26 | cj( "#" + fldName + "_custom_html").hide( ); | |
27 | cj( "#" + fldName + "_custom" ).val(''); | |
28 | } | |
29 | } | |
30 | {/literal} | |
31 | </script> |