Merge pull request #17595 from eileenmcnaughton/settings
[civicrm-core.git] / templates / CRM / Profile / Form / GreetingType.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
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 |
8 +--------------------------------------------------------------------+
9 *}
10 {assign var="customGreeting" value=$n|cat:"_custom"}
11 <span>{$form.$n.html|crmAddClass:big}</span>&nbsp;<span id="{$customGreeting}_html" class="hiddenElement">{$form.$customGreeting.html|crmAddClass:big}</span>
12
13 <script type="text/javascript">
14 var fieldName = {$n|@json_encode};
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>