I want to use the country and region/state fields in the custom form of my custom module.
I am able to get countries list & states list of US now i want to update regions on the basis of country selected but i am not able how i can use /app/code/core/Mage/Checkout/view/frontend/js/region-updater.js
here.
Thanks,
Best Answer
Looking at
Magento_Customer/view/frontend/templates/form/register.phtml
, theupdate-region.js
is being including like this:You can place this code in your template and have your block class extend from
Magento\Customer\Block\Form\Register
.This requires that you have the elements
#region_id
,#region
,#zip
,#country
and that your form is#form-validate
.Fields should be as follows: