How can I edit the contents of a datalist element based on a selection made in another dropdown

31 Views Asked by At

I'm writing a section of a Django template file for inputting multiple fields using dropdown menus. Two of the sections are 'State' and 'County'; currently the county dropdown list is just a datalist of all the counties in the entire country, but I would like to use some Javascript to rewrite the datalist whenever a selection is made in the State dropdown option to show only the counties in that particular state. Any suggestions are appreciated!

0

There are 0 best solutions below