Topic: Date Picker 5 - Uncaught TypeError: Cannot read property 'readOnly' of null

EMSupport priority asked 3 years ago


Expected behavior Show calendar icon (button) and no error

Actual behavior There is no calendar icon and there is a error "Uncaught TypeError: Cannot read property 'readOnly' of null"

Resources (screenshots, code snippets etc.)https://mdbootstrap.com/snippets/standard/emsupport/3219467


Dawid Wajszczuk staff answered 3 years ago


Hi,

@UNNdev is right, but I couldn't open his snippet. So here is the example with JS init https://mdbootstrap.com/snippets/standard/d-wajszczuk/3220568#js-tab-view . But you can do the same with just HTML and data-attributes, here is another snippet https://mdbootstrap.com/snippets/standard/d-wajszczuk/3220575#html-tab-view . For more information and examples visit our documentation https://mdbootstrap.com/docs/standard/forms/datepicker/ .

Keep coding,
Dawid


UNNdev priority answered 3 years ago


You must wrap the input with a div with relative position and init the Datepicker on the wrapper.

https://mdbootstrap.com/snippets/standard/kayem79/3220007


Realmonitor Ltd priority commented 3 years ago

I have the same problem, unfortunately I can't see your example.


Dawid Wajszczuk staff commented 3 years ago

I have provided the solution in the comment above.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.8.1
  • Device: PC
  • Browser: Chrome
  • OS: Window 10
  • Provided sample code: No
  • Provided link: Yes