I am using select2 jQuery plugin to make Magento HTML select nicer. The plugin replaces the actual select with a set of tag which replicate the functionalities of the select. Doing in this way I am missing some default beahviour of Magento select, such as the switch between dropdowns countries and address input field when United States are selected.

Anyone knows where this functionalities are inside Magento js scripts?

  • Maybe you can use onchange='jsfn()' in the input.
    – mbalparda
    Commented Jan 26, 2015 at 14:24
  • but I don't know which is function is called when the country select changes
    – giani.sim
    Commented Jan 26, 2015 at 14:39
  • Did you ever get this to work? I am researching how to fix this issue now. Commented Sep 14, 2016 at 17:15

1 Answer 1


Code you are looking for is in js/varien/form.js file. Look for RegionUpdater = Class.create(); line, inside initialize function, you are probably interested in following line:

Event.observe(this.countryEl, 'change', this.update.bind(this));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.