Connected selects from the server

The regions are requested when the page loads and added as options. Choosing a region requests its towns and adds them to the second select. Each array is loaded into a classed placeholder option, which is copied once per item.

Result

Template

Script

Options added by an earlier load stay in the select, so the script removes the old towns before loading new ones.