*}
<div class="crm-block crm-form-block crm-{$formName}-block">
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
- <table class="form-layout">
+ {if $formName == "Contribute_Preferences" }
+ <table class="form-layout">
+ <tr class="crm-preferences-form-block-invoicing">
+ <td>
+ {$form.invoicing.html} {$form.invoicing.label}
+ </td>
+ </tr>
+ </table>
+ {/if}
+ <table class="form-layout" id="invoicing_blocks">
{foreach from=$fields item=field key=fieldName}
{assign var=n value=$fieldName}
{if $form.$n}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
</div>
+{if $formName == "Contribute_Preferences"}
+ {literal}
+ <script type="text/javascript">
+ cj(document).ready(function() {
+ if (document.getElementById("invoicing").checked) {
+ cj("#invoicing_blocks").show();
+ }
+ else {
+ cj("#invoicing_blocks").hide();
+ }
+ });
+ cj(function () {
+ cj("input[type=checkbox]").click(function() {
+ if (cj("#invoicing").is(":checked")) {
+ cj("#invoicing_blocks").show();
+ }
+ else {
+ cj("#invoicing_blocks").hide();
+ }
+ });
+ });
+ </script>
+ {/literal}
+{/if}