Open Closed

Change Date Input #8177


User avatar
0
nabass created

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,)
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    0
    salih created
    Support Team .NET Developer

    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());
        });
    });
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    nabass created

    hi salih it works thank you :)

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.