subtype might legitimately be empty
authordemeritcowboy <demeritcowboy@hotmail.com>
Wed, 8 Sep 2021 20:27:38 +0000 (16:27 -0400)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Wed, 8 Sep 2021 20:27:38 +0000 (16:27 -0400)
templates/CRM/Contact/Form/Edit/Individual.tpl

index 5139e05ee1fec672d07c681c9bc4026840473300..fe8da27023477ba4e9d8d2f9ab664476b005f3c9 100644 (file)
@@ -8,16 +8,6 @@
  +--------------------------------------------------------------------+
 *}
 {* tpl for building Individual related fields *}
-<script type="text/javascript">
-{literal}
-CRM.$(function($) {
-  if ($('#contact_sub_type *').length == 0) {//if they aren't any subtype we don't offer the option
-    $('#contact_sub_type').parent().hide();
-  }
-});
-</script>
-{/literal}
-
 <table class="form-layout-compressed">
   <tr>
     {if $form.prefix_id}
@@ -71,9 +61,11 @@ CRM.$(function($) {
       {$form.nick_name.label}<br />
       {$form.nick_name.html}
     </td>
+    {if !empty($form.contact_sub_type)}
     <td>
       {$form.contact_sub_type.label}<br />
       {$form.contact_sub_type.html}
     </td>
+    {/if}
   </tr>
 </table>