{"id":3424,"date":"2024-02-28T07:59:29","date_gmt":"2024-02-28T07:59:29","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/magento-2-registration-form-not-showing-state-dropdown\/"},"modified":"2025-07-22T12:37:01","modified_gmt":"2025-07-22T07:07:01","slug":"magento-2-registration-form-not-showing-state-dropdown","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/magento-2-registration-form-not-showing-state-dropdown\/","title":{"rendered":"Fix: Magento 2 Registration Form Not Showing State Dropdown"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hey Devs!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Are you facing the Magento 2 state\/province dropdown not loading issue? Follow me till the end of this post to learn how to solve it.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2024\/02\/StateProvince-field-is-required-but-still-showing-in-register-page-but-not-visible-textbox.png\" alt=\"Magento 2 registration form\" class=\"wp-image-43892\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">We love Magento for its extensive customizability and flexibility, thanks to its open-source nature. But quite often, it contains unexpected bugs like missing state\/province field <a href=\"https:\/\/meetanshi.com\/blog\/create-a-b2b-registration-form-in-magento-2\/\">Magento 2 registration form<\/a>. Generally, the state\/province is a mandatory field in Magento 2 customer registration and this type of issue can hold the checkouts\/account creations.<br><br>Therefore, it is recommended to fix the \u201caddress from state\/province dropdown not showing on Magento 2\u201d issue asap!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Magento 2 Registration Form is Not Showing State Dropdown?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The missing state\/province field Magento 2 registration issue can be because of missing configuration in theme or module. The issue generally occurs when the default configuration settings are overridden by customizations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Fix State\/Province Field Missing on Magento 2 Registration Form?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Follow the steps mentioned below to solve the \u201cAddress form state\/province dropdown missing\u201d issue in Magento 2:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, create a new register.phtml file to override the default one. (You can skip this step if you already have one.)<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to <strong>[root]\/vendor\/magento\/module-customer\/view\/frontend\/templates\/form\/<\/strong> directory.<\/li>\n\n\n\n<li>Copy the <code>register.phtml<\/code> file.<\/li>\n\n\n\n<li>Place the file inside your <a href=\"https:\/\/meetanshi.com\/blog\/magento-2-folder-structure\/\" target=\"_blank\" rel=\"noreferrer noopener\">theme directory<\/a>: for e.g., <strong>[root]\/app\/design\/frontend\/&lt;vendor_name&gt;\/&lt;template_name&gt;\/Magento_Customer\/templates\/form\/<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In the overridden <code>register.phtml<\/code> file, locate the JavaScript object responsible for initializing the region updater component.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will need to replace the lines responsible for passing the regionJson, defaultRegion, and countriesWithOptionalZip to the JavaScript component.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Replace the following lines:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"regionJson\": {$regionJson},\n\"defaultRegion\": \"{$regionId}\",\n\"countriesWithOptionalZip\": {$countriesWithOptionalZip}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>with<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\"regionJson\": &lt;?= $regionJson ?>,\n\"defaultRegion\": &lt;?= $regionId ?>,\n\"countriesWithOptionalZip\": &lt;?= $countriesWithOptionalZip ?><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, the variables will be correctly echoed and not escaped, fixing the \u201cState\/province dropdown not showing on new account creation page\u201d issue in Magento 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you\u2019re done modifying the code, <a href=\"https:\/\/meetanshi.com\/blog\/clear-magento-2-cache\/\" target=\"_blank\" rel=\"noreferrer noopener\">flush Magento 2 cache<\/a> using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>php bin\/magento cache:flush<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it! The \u201cMagento 2 Registration Form Not Showing State Dropdown\u201d will be solved!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please feel free to comment down if you\u2019ve any doubts or queries. Thanks for reading.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><div class=\"meetanshi-cta\">\r\n<div class=\"cta-content-wrapper\">\r\n<span>Magento 2 B2B Registration Form<\/span>\r\n<p>Go beyond the default registration form and create a customized one.<\/p>\r\n<a href=\"https:\/\/meetanshi.com\/magento-2-b2b-registration-form.html\" target=\"_blank\" class=\"btn-primary\">Create One Now <\/a>\r\n<\/div>\r\n<div class=\"cta-image-new\">\r\n<img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2025\/11\/b2b-registration-form.png\" alt=\"Magento 2 B2B Registration Form\">\r\n<\/div>\r\n<\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey Devs! Are you facing the Magento 2 state\/province dropdown not loading issue? Follow me till the end of this post to learn how to solve it. We love Magento for its extensive customizability and flexibility, thanks to its open-source nature. But quite often, it contains unexpected bugs like missing state\/province field Magento 2 registration [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-3424","post","type-post","status-publish","format-standard","hentry","category-magento"],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/3424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=3424"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/3424\/revisions"}],"predecessor-version":[{"id":24297,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/3424\/revisions\/24297"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=3424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=3424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=3424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}