Support (offered by community volunteers) > Using Profiles

TIP: How to copy address to Profile using JavaScript "Same as billing address"

<< < (6/8) > >>

ryeradio:
I am using this code from the civi documentation

http://wiki.civicrm.org/confluence/display/CRMDOC41/Add+'Same+as+billing+address'+button+for+convenience

and everything works great, except for the state is not populating. Does anyone know why the state would not be populating?

Kurund Jalmi:

--- Quote ---Does anyone know why the state would not be populating?
--- End quote ---

"State" select options are loaded via ajax, i.e. it is loaded based on selected "Country" field. Hence you need to set the country first and then set the state.
As mentioned by Eileen this is already part of 4.2 release.

This patch might give you rough idea about the changes: https://fisheye2.atlassian.com/changelog/CiviCRM?cs=41098

HTh
Kurund

tso2085:
Seeking assistance....

I used this code:
http://wiki.civicrm.org/confluence/display/CRMDOC41/Add+'Same+as+billing+address'+button+for+convenience

to populate from onbehalf of organization during membership signup to an additonal profile for the primary contact, on the same signup page.

However, it is not working.  When I check the box to copy the address info, it does nothing.

For this scenario, the fields are a little different (onbehalf_organization_name, for instance) and am copying it to individual's work address fields (which end in "-2), but I think it should still work.

In my case, do I have more than one "form" on the page and need to distinguish that in the code perhaps?

Any assistance from you gurus would be greatly appreciated!

Craig

Eileen:
We have this working in our 4.1.5 deployment (the 6.x.1.x or 7.x.1.x branch here)

git://github.com/fuzionnz/civicrm.git

Note that in both cases the 'drupal' folder is a submodule so you'd need

git clone git://github.com/fuzionnz/civicrm.git
cd civicrm
git branch 6.x.1.x
git submodule update --init

Eileen:
Or better yet - grab the next 4.2 BETA & test using that (where it should be in core)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version