From d410f22254a0761f1af583ef4d0d80765279084e Mon Sep 17 00:00:00 2001 From: Kevin Ramirez Date: Thu, 3 Nov 2022 01:56:00 -0600 Subject: [PATCH] Fix #79 -- Clear values of related fields (#137) Co-authored-by: Kevin Ramirez --- django_select2/static/django_select2/django_select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_select2/static/django_select2/django_select2.js b/django_select2/static/django_select2/django_select2.js index 200534ba..f2358df0 100644 --- a/django_select2/static/django_select2/django_select2.js +++ b/django_select2/static/django_select2/django_select2.js @@ -59,7 +59,7 @@ } $element.on('select2:select', function (e) { var name = $(e.currentTarget).attr('name') - $('[data-select2-dependent-fields=' + name + ']').each(function () { + $('[data-select2-dependent-fields~=' + name + ']').each(function () { $(this).val('').trigger('change') }) })