diff --git a/app/templates/element/javascript.php b/app/templates/element/javascript.php index e65693ed6..8007646b4 100644 --- a/app/templates/element/javascript.php +++ b/app/templates/element/javascript.php @@ -88,6 +88,16 @@ $(this).removeClass('hasValue'); } }); + + // DUET DATEPICKER + // We use the accessible Duet Datepicker only for its picker - never for its + // input fields. Strip out the Duet input fields if they exist so the forms never + // attempt to submit them. This will also fix any issues with missing labels. + let dateWidgetInputs = document.querySelectorAll('duet-date-picker input'); + // Remove all the Vue related fields + Array.prototype.slice.call(dateWidgetInputs).forEach( (el) => { + el.parentNode.removeChild(el); + }); // TOP FILTER FORM // Send only non-empty fields in the form @@ -128,13 +138,6 @@ $(filterId).val(""); }); - // Remove the Vue date fields if exist - let dateWidgetInputs = document.querySelectorAll('duet-date-picker input'); - // Remove all the Vue related fields - Array.prototype.slice.call(dateWidgetInputs).forEach( (el) => { - el.parentNode.removeChild(el); - }); - $(this).closest('form').submit(); });