diff --git a/Layout/default/ConstructionConsent/Form.php b/Layout/default/ConstructionConsent/Form.php
index 5a9d3d560..e3546467c 100644
--- a/Layout/default/ConstructionConsent/Form.php
+++ b/Layout/default/ConstructionConsent/Form.php
@@ -36,7 +36,7 @@
@@ -76,28 +76,28 @@
@@ -107,7 +107,7 @@
@@ -115,7 +115,7 @@
@@ -125,7 +125,7 @@
@@ -135,7 +135,7 @@
@@ -145,7 +145,7 @@
@@ -166,7 +166,7 @@
@@ -207,7 +207,14 @@
*/
$('#adb_strasse_id').select2({
ajax: {
- url: '=self::getUrl("ConstructionConsent", "api", ["do" => "findStreet", "project_id" => $project->id])?>',
+ url: '=self::getUrl("ConstructionConsent", "api")?>',
+ data: (params) => {
+ return {
+ q: params.term,
+ do: "findStreet",
+ project_id: $("#constructionconsentproject_id :selected").val()
+ }
+ },
delay: 250,
dataType: 'json'
},
@@ -220,6 +227,11 @@
$('#new-address-toggle').show();
}
});
+
+ $("#constructionconsentproject_id").change(() => {
+ $("#adb_strasse_id").val("").change();
+ });
+
\ No newline at end of file
diff --git a/Layout/default/ConstructionConsent/Index.php b/Layout/default/ConstructionConsent/Index.php
index 4bb41f954..129de256c 100644
--- a/Layout/default/ConstructionConsent/Index.php
+++ b/Layout/default/ConstructionConsent/Index.php
@@ -36,8 +36,8 @@ $pagination_entity_name = "Zustimmungserklärungen";
@@ -62,7 +62,7 @@ $pagination_entity_name = "Zustimmungserklärungen";