Comments (1)
🤖
Hey @germanrandhawa, nice to see you back! How’s everything going?
Based on the information you've provided, it seems like the issue might be related to how Contact Form 7 is processing the form data.
For the city field, make sure that the value of the selected option is being correctly set and passed when the form is submitted. The value of the selected option should be the one that appears in the email, not the attribute name. If the value is not being set correctly, it could result in "undefined" appearing in the email.
As for the country and state fields printing codes instead of full names, this is likely due to how the data is structured in the countries-states-cities-database
repository. The country and state data is stored using their respective codes, not their full names.
To print the full names instead of the codes, you would need to map the codes to their corresponding names. This could be done by creating a lookup table or dictionary that maps each code to its full name, and then using this to replace the codes with their full names in the email.
Here's a simple example of how you could create such a lookup table for countries:
$countriesJson = file_get_contents("data/countries.json");
$countriesArray = json_decode($countriesJson, true);
$countryCodeToName = array();
foreach($countriesArray as $country) :
$countryCodeToName[$country['code']] = $country['name'];
endforeach;
You could do something similar for states, but you would need to read the state data from the appropriate JSON file based on the country code.
Please note that this is a general guidance and the actual implementation might vary based on your specific setup and requirements.
As for the image you've shared, I'm sorry but I'm unable to view images. If you need to share code or error messages, please paste them as text.
Let me know if you need further clarification or assistance.
Sources
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from countries-states-cities-database.
Related Issues (20)
- city do not change when selected in the dropdown i guess the error is related to values of option the value is same for all options HOT 4
- Hi, i would like to add city Ulaanbaatar the capital of mongolia.
- Missing Cities And States Of Greece HOT 2
- Add to a new country and 5 new cities, some data editing information HOT 2
- countries.sql -> emoji column has '??' HOT 1
- Invalid state code for Uttarakhand (India)
- Duplicate entries
- The listing of Friedens in Pennsylvania should be Friedensburg. HOT 3
- Buenos Aires Province and Ciudad Autonoma de Buenos Aires HOT 2
- Import Error world.sql HOT 2
- Missing cities in Hampshire HOT 1
- Errors while trying to run the sql file HOT 1
- Cities on Philippines per state incomplete HOT 1
- Spanish cities missing lat/long HOT 1
- Wrong city name showing for below information HOT 1
- Wrong cities in DRC HOT 1
- API key request page broken HOT 1
- what is the flag field for? HOT 1
- Can i have just the country, state, cities
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from countries-states-cities-database.