Topic: Datepicker - Selecting date on calendar triggers form submission
fkmccallion
pro premium asked 5 months ago
when selecting a date on the datepicker it sets the input value. Instead, I would like the date selection to set the input value and trigger the form submission.
Marcin Luczak
staff answered 5 months ago
Hi,
You can achieve that by adding an event listener to the datepicker listening to its change event with submit form callback. Please check the snippet below:
https://mdbootstrap.com/snippets/jquery/marcin-luczak/2613336
Regards, Marcin
fkmccallion pro premium commented 5 months ago
Thanks for your help Marcin! I guess I was thinking that you had a custom method for this but the standard change event works perfectly well. Again, thanks for your quick response!
Resolved
- User: Pro
- Premium support: Yes
- Technology: jQuery
- MDB Version: 4.19.1
- Device: mac
- Browser: chrome
- OS: mohave
- Provided sample code: No
- Provided link: No