1

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 Jan 26 '15 at 14:24
  • but I don't know which is function is called when the country select changes – gianis6 Jan 26 '15 at 14:39
  • Did you ever get this to work? I am researching how to fix this issue now. – RussellAlbin Sep 14 '16 at 17:15
2

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, privacy policy and cookie policy

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