Address form: Fix "copy from above" for the "State" field

This commit is contained in:
Raphael Michel
2025-02-14 13:09:30 +01:00
committed by GitHub
parent 225349d7e6
commit f53ae59698

View File

@@ -710,7 +710,10 @@ function copy_answers(elements, answers) {
input.val(answers.filter("[name$=" + suffix + "]").val());
break;
case "select":
input.val(answers.filter("[name$=" + suffix + "]").find(":selected").val()).change();
// save answer as data-attribute so if external event changes select-element/options it can select correct entries
// currently used when country => state changes
var answer = answers.filter("[name$=" + suffix + "]").find(":selected").val();
input.prop("data-selected-value", answer).val(answer).change();
break;
case "input":
switch (attributeType) {