Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
Index: templates/CRM/Contribute/Form/Contribution/Main.tpl ===================================================================--- templates/CRM/Contribute/Form/Contribution/Main.tpl (revision 36074) +++ templates/CRM/Contribute/Form/Contribution/Main.tpl (working copy) @@ -243,6 +243,7 @@ {/if} {if $is_monetary} + <input type="checkbox" id="billingcheckbox"> {ts}Billing Address is same as above{/ts} {include file='CRM/Core/BillingBlock.tpl'} {/if} @@ -310,6 +311,34 @@ {/if} <script type="text/javascript"> +{literal} +cj( function( ) { + cj('#billingcheckbox').click( function( ) { + sameAddress( this.checked ); + }); + }); + +function sameAddress( setValue ) { + var locationTypeInProfile = 1; + var orgID = field = fieldName = null; + cj('.billing_name_address-section input').each( function( i ){ + orgID = cj(this).attr('id'); + field = orgID.split('-'); + fieldName = field[0].replace('billing_', ''); + if ( field[1] ) { + fieldName = fieldName.replace('_id', ''); + fieldName = fieldName + '-' + locationTypeInProfile; + } + if ( setValue ) { + cj(this).val( cj('#' + fieldName ).val() ); + } else { + cj('#' + fieldName ).val(''); + } + }); +} +{/literal} + + {if $pcp}pcpAnonymous();{/if} {literal} var is_monetary = {/literal}{$is_monetary}{literal}
Does anyone know why the state would not be populating?