We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14547
    • 58 Posts
    I’m using [+phx:userinfo=`country`+] to autofill the user’s country in a formfield. the problem is that I’m getting the countries number (e.g. United States(223)) instead of the countries name.

    How can I change it so I get the name of the country instead of the related number?
      ~~||[ Simplicity is everything ]||~~
      • 12003
      • 21 Posts
      I face the similar problem. i was using drop down for countries. like <option value="1" >India</option>, which return "1"

      Changed it to <option value="India" >India</option>, which works for me.
        • 17499 ☆ A M B ☆
        • 872 Posts
        Facing the same issue with Revolution output filter.

        I had to use a snippet call before using the userinfo.
          • 14547
          • 58 Posts
          Changing the option value didn’t work for me.
          The following files were changed (value="relatedcountry"):

          - In the admin panel/manager all the form chunks that contain the country option
          - In /assets/snippets/webloginpe/Default Forms all the form chunks that contain the country option
          - In /assets/snippets/weblogin -> websignup.inc.php

          It looks like the country value’s coming from the table ’modx_web_user_attributes’->country
          Looks like the snippet webloginPE is using this file to store the country data:

          - In /assets/snippets/webloginpe/Default Forms -> countryCodes.php
          Which is defined as:
          <?php
          $countryCodes = '[+COUNTRYLABEL+]:wlpeUserProfileCountry:country:select:
          United States(223),
          Afghanistan(1),


          Thus saving the value of 223 for the U.S. right?
          So I’ve tried to change the United states value as follows:
          United States("United States")

          After that when I go to my userprofile (logged in as registered user)
          And re-save my country to "United States", I’m not getting a value. Then again, when I return to my profile and change to any other country, I’m getting back the related country code/value..

          What am I missing..
            ~~||[ Simplicity is everything ]||~~