Comboboxes how to?

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

abcde

Established Member
Impact
16
hi everyone,

I want to make 2 comboboxes: country and city, but I want the values on city change base on that country user select.

ex: if we select USA then we will see New York but not Tokyo, but if we select Japan then we only see Tokyo, not NY.

How do i do that?


Code:
<select  name="country">
  <option disabled selected>Select</option>
  <option value="us">USA</option>
  <option value="japan">Japan</option>
</select>

<select  name="city">
  <option disabled selected>Select</option>
  <option value="1">New York</option>
  <option value="1">Tokyo</option>
</select>
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
That can't be done with HTML alone, so you'll need to use JavaScript. On the first combo box, you can add an onchange event that looks at the selection and populates the second combo box accordingly.
 
0
•••
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
CryptoExchange.com
Domain Recover

NamePros updates

Portfolio sites: new ways to sort, filter and group your domains
Your public portfolio page has a few new tools for visitors. Portfolio: Newest first The sort menu now has "Newest first". It shows the...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back