I need through javascript that the commune is selected in the combobox depending on the region that I select in the previous combobox In my models.py I have it as follows:
class Region(models.Model):
nro_region = models.IntegerField(unique=True, verbose_name="Nro. Región")
nombre = models.CharField(max_length=60)
class Comuna(models.Model):
nombre = models.CharField(max_length=60)
region = models.ForeignKey(Region, on_delete=models.CASCADE)
So in my template I have 2 combobox, but depending on the region that I select, I have to load the communes that belong to that region. How can I get it with javascript? Thanks a lot.