Skip to content
Advertisement

Datepicker on “focus” event in Laravel

I have a datatable where I have the option to edit the date of every record in that table, so I need to use “document on focus” event to get all my datepickers to work. The problem here is that my datepicker only works when I click on the input, if I click in the “icon” it doesn´t work.

This is my datepicker in the form:

JavaScript

and this is the javascript:

JavaScript

if I dont use on focus event my datepicker works fine, doesn´t matter if I click on the input or the icon, but I need to use this event because if I dont, my datepicker will only works on the first record in the table.

Advertisement

Answer

I used class div instead of the id like someone said and now everything its working without using the focus event.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement