Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/2winners/html_form-country-state-select
Premade Simple Country and Automatic State/Province options
https://github.com/2winners/html_form-country-state-select
form form-select html js json php
Last synced: about 1 month ago
JSON representation
Premade Simple Country and Automatic State/Province options
- Host: GitHub
- URL: https://github.com/2winners/html_form-country-state-select
- Owner: 2winners
- License: mit
- Created: 2024-11-28T02:56:46.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-28T04:21:44.000Z (about 1 month ago)
- Last Synced: 2024-11-28T04:26:31.543Z (about 1 month ago)
- Topics: form, form-select, html, js, json, php
- Language: PHP
- Homepage:
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HTML_Form-country-State-Select
Premade Simple Country and Automatic State/Province options
uses :
#HTML
#PHP
#JS
#JSONThis HTML - PHP - JS code can be used to easy implement a SELECT form field where you want any country and then Any state of that country
the simple json format where the options are Pre Optioned and just need to be print or inserted into the HTML
```json{
"Countries": {
"CountryName": {
"option": "CountryName",
"phonecode":"0",
"States": [
"State1",
"State2"
]
},
"United Kingdom":{
"Option":"\u003Coption value='United Kingdom'\u003EUnited Kingdom\u003C\/option\u003E",
"phonecode":"44",
"States":{
"England":"\u003Coption value='England'\u003EEngland\u003C\/option\u003E",
"Northern Ireland":"\u003Coption value='Northern Ireland'\u003ENorthern Ireland\u003C\/option\u003E",
"Scotland":"\u003Coption value='Scotland'\u003EScotland\u003C\/option\u003E",
"Wales":"\u003Coption value='Wales'\u003EWales\u003C\/option\u003E"
}
},
...
}
}```
The Example_Location.php + Options.json can be run directly and is a functioning form that can be posted to try it.
The Barebones.php + Options.json file is all thats needed to make it work