| CARVIEW |
Select Language
HTTP/2 301
cache-status: "Netlify Edge"; fwd=miss
content-type: text/html
date: Tue, 30 Dec 2025 05:18:52 GMT
location: /examples/value-select/
server: Netlify
strict-transport-security: max-age=31536000
x-nf-request-id: 01KDPV3QMH9MA9QY1FDN3Q3KYR
content-length: 98
HTTP/2 200
accept-ranges: bytes
age: 0
cache-control: public,max-age=0,must-revalidate
cache-status: "Netlify Edge"; fwd=miss
content-encoding: gzip
content-type: text/html; charset=UTF-8
date: Tue, 30 Dec 2025 05:18:52 GMT
etag: "17a6018c9b2d3ca463e374d3d2ea2581-ssl-df"
server: Netlify
strict-transport-security: max-age=31536000
vary: Accept-Encoding
x-nf-request-id: 01KDPV3R0GW8E30V1PP7VV8YG7
</> htmx ~ Examples ~ Cascading Selects
Cascading Selects
In this example we show how to make the values in one select depend on the value selected in another select.
To begin we start with a default value for the make select: Audi. We render the model select for this make. We
then have the make select trigger a GET to /models to retrieve the models options and target the models select.
Here is the code:
<div>
<label >Make</label>
<select name="make" hx-get="/models" hx-target="#models" hx-indicator=".htmx-indicator">
<option value="audi">Audi</option>
<option value="toyota">Toyota</option>
<option value="bmw">BMW</option>
</select>
</div>
<div>
<label>Model</label>
<select id="models" name="model">
<option value="a1">A1</option>
...
</select>
<img class="htmx-indicator" width="20" src="/img/bars.svg" alt="Saving...">
</div>
When a request is made to the /models end point, we return the models for that make:
<option value='325i'>325i</option>
<option value='325ix'>325ix</option>
<option value='X5'>X5</option>
And they become available in the model select.
Server Requests ↑ Show