hi I have 2 date inputs so i made a logic when changing on one of them another on will updated auto as code below when i tried same js code on normal html file it works perfectly when i use same code on ABP it doesn't work so is there a special something i should do first ??
<abp-column size="_4">
<abp-date-picker id="documentDate" auto-update-input="true" today-button-classes="btn-primary" asp-for="Purchase.DocumentDate" label="@L["DocumentDate"].Value" />
</abp-column>
<abp-column size="_4">
<abp-date-picker id="vendorInvoiceDate" auto-update-input="true" today-button-classes="btn-primary" asp-for="Purchase.VendorInvoiceDate" label="@L["VendorInvoiceDate"].Value" />
</abp-column>
<script>
const vendorInvoiceDate = document.getElementById('vendorInvoiceDate');
const documentDate = document.getElementById('documentDate');
vendorInvoiceDate.addEventListener('change', function (event) {
documentDate.value = event.target.value;
});
</script>
- ABP Framework version: v8.0.2
- UI Type: MVC
- Database System: EF Core (SQL Server,)
2 Answer(s)
-
0
Hi, abp-date-picker uses jquery, so if you replace your code as jquery code it will work.
document.addEventListener('DOMContentLoaded', function () { const $vendorInvoiceDate = $('#vendorInvoiceDate'); const $documentDate = $('#documentDate'); $vendorInvoiceDate.on('change', function () { $documentDate.val($vendorInvoiceDate.val()); }); });
-
0
hi salih it works thank you :)