Details
-
Type:
Improvement
-
Status: Done/Fixed
-
Priority:
Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.0.8
-
Fix Version/s: 4.2.0
-
Component/s: None
-
Labels:None
Description
I've been testing with "on behalf of" for a Contribution form, but it probably affects all profiles: in a profile with state/country fields, when a default country is set, the state/province field lists all available values for all countries. I would expect that if, say, Canada is selected by default, then the list of state/provinces should be only those of Canada.
If I re-select the default country, it does an ajax refresh and it's OK.
I tried to fix it correctly (see attached patch), but when the form is submitted and has errors (in other fields), I have difficulties getting the value of the 'country' that was submitted so that I can generate a list of state/provinces for that country. More specifically, I don't know how to get the bltID for the 'onbehalf'.
As a lazy work-around, my patch limits the state/provinces if it's the initial form display, but if values were submitted, it lists all (since anyway, at that point, it's likely that the user selected a state/province).