I'm coding a registration Form in a Symfony 4 App.

I have a field ZipCode and field City.
The list of cities and zipcode are in a table named `communes`.
When the user fills up the form, I want him to fill up just his zipcode, and then load the cities with this zipcode in a list.

I did this 

RegistrationFormType.php

```
 ->add("codePostal", TextType::class, [
                "mapped"=>false, 
                "label"=>"Code postal",
                ])
 ->add('commune', EntityType::class, [
                'class' => Commune::class,
                'choice_label' => 'nom',
                'placeholder' => "Choisir une ville",
            ])

```

And then in the template i play with Jquery and a Json call to change the list
register.html.twig

```
<script>
let dropdownCommune = $('#registration_form_commune');
dropdownCommune.empty();

$("#registration_form_codePostal").change(function() {
  $.ajax({
    url: "{{ path('app_commune_json_list_communes') }}", // point to server-side PHP script
    dataType: 'json',
    data: {
      data: this.value
    },
    type: 'POST',
    success: function(data) {
      dropdownCommune.empty();
      dropdownCommune.prop('selectedIndex', 0);

      $.each(data, function(key, entry) {
        //console.log(entry.departement);
        dropdownCommune.append($('<option></option>').attr('value', entry.id).text(entry.nom));
      });
    }
  });
});
</script>

```

This works but my problem is that the `commune` field loads all the cities of the database at first load of the page. This takes a long time and I'm sure there is a way to stop it, but I can't find a way to do it.