Click here to Skip to main content
15,887,288 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I want to show country dropdown and state dropdown based on selected country and show city dropdown based on selected country and state

What I have tried:

I tried to show country dropdown and state dropdown based on selected country and show city dropdown based on selected country and state but it is not working fine please provide solution for this
Posted
Updated 10-Nov-23 6:15am
v2
Comments
Mike Hankey 10-Nov-23 11:17am    
We don't provide solutions on demand.

Show what you've done and were you are stuck and you will have a lot better chance of getting an answer.
Andre Oosthuizen 10-Nov-23 12:17pm    
Quote from online - "What is Coding? “Writing code,” “coding,” and “programming” are basically interchangeable terms. Broadly speaking, knowing how to write code is the process of creating instructions that tell a computer what to do, and how to do it."
[no name] 10-Nov-23 13:00pm    
It's called "filtering". Each (higher) selection filters the data avalable to subsequent (lower) selections. Geographic data is hierarchical. Use the "selection changed" event to initiate a filter "cascade".
Rudi Breedenraedt 10-Nov-23 17:51pm    
How funny, I justed posted an article on how to do that !
https://www.codeproject.com/Articles/5372446/Build-Rich-Web-Apps-with-ASP-NET-Core-and-Sircl-2
But its not for React. I guess Maciej's response will help you.
Just found the odds... ;)

1 solution

Start here: Create Cascading Dropdown In ReactJS[^]
This all what you need (country->state->city)!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900