Reproduce :
1. Make an order
2. Set a the country in the address to a non default country (and watch the states update).
3. Reload the page.
4. Notice that while the country is correct, the states list is now for the default country, not the currently selected.
Idea for a solution.
On document ready do a check of the country field to see if its default and if not, fire off the onchange hook.
Comments
Comment #1
rszrama commentedHmm... so, not exactly sure how to handle this... If someone refreshes a form in progress, does it save things like the values they've entered in textfields? It seems to me like a refresh should reset everything to default... Thoughts on that?
Also, this is a little tricky, but if we decide to do anything about this, we should really have a solution that works for anywhere the country/zone select magic is used.
Comment #2
cha0s commentedI've found this problem before. I find the best way to solve it is as follows:
Create a function that maps the current state of your widget to a certain action. For instance, map each country option to the action to fill the other select with its states.
Create a $(document).ready and behaviors on the given selectors, calling your function specified before.
I'll show ya what I mean if there isn't already a better solution up by then.
Comment #3
cha0s commentedWe should probably postpone this until we figure out the AHAH stuff on the zone selects.
Comment #4
tr commentedIs this still an issue with the latest version of Ubercart?
Comment #5
freatida commentedIt is for me, yes.
Comment #6
cha0s commentedDid Lyle get AHAH on the selects yet, or is it still the adhoc mess that it was before?
Comment #7
tr commentedI can't reproduce this in the current version of 6.x-2.x-dev, so I'm going to assume it was fixed by one of the many changes we've made over the past two years. If you still have similar problems, please open a new issue with updated steps to reproduce the problem.