monim67 / django-bootstrap-datepicker-plus

Bootstrap3/Bootstrap4/Bootstrap5 DatePickerInput, TimePickerInput, DateTimePickerInput, MonthPickerInput, YearPickerInput with date-range-picker functionality for django >= 2.0
https://pypi.python.org/pypi/django-bootstrap-datepicker-plus
MIT License
223 stars 61 forks source link

Using custom JS to set a date is not working as expected #103

Open RichardWoj opened 11 months ago

RichardWoj commented 11 months ago

Describe the problem I need to set an "issuance date" to today's date as soon as the user has filled an amount field for an invoice. I do so with a javascript: const issuanceDateInput = container.querySelector('.issuance-date-input input[type="text"]'); amountInput.addEventListener('change', () => { if (amountInput.value !== "") { issuanceDateInput.value = formatDate(new Date()); issuanceDateHiddenInput.value = formatDate(new Date());

The calculated value is displayed on the browser but the value is not in the post message sent to the server Do I have to trigger some event?

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior I am expecting the value displayed by the browser to be part of the post message sent to the server

Console errors

Paste-bin The page is showing up but the date-picker calendar is not. The paste-bin link of the HTML source of the page is http://...

Setup Information (please complete the following information):

[x] I have followed the configuration instructions and checked out the common error troubleshooting page.

silvioba commented 6 months ago

I observed this too. It's very annoying. How did you fixed @RichardWoj ?