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

rszrama’s picture

Issue tags: +dc2009 code sprint

Hmm... 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.

cha0s’s picture

I'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.

cha0s’s picture

Status: Active » Postponed

We should probably postpone this until we figure out the AHAH stuff on the zone selects.

tr’s picture

Status: Postponed » Active

Is this still an issue with the latest version of Ubercart?

freatida’s picture

It is for me, yes.

cha0s’s picture

Did Lyle get AHAH on the selects yet, or is it still the adhoc mess that it was before?

tr’s picture

Status: Active » Closed (cannot reproduce)

I 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.