NameSilo

Comboboxes how to?

SpaceshipSpaceship
SpaceshipSpaceship
NamecheapNamecheap
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
Close
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
Close
0
Close
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Each character of a domain name in its own box, with how to type one of them
Bookmarks: see bookmarks without a label
You can now show only the bookmarks you have not labeled. Open the label filter in the Bookmarks tab of your account menu, or on your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back