Miguel Angel Moreno pro asked 6 years ago


good afternoon how can I get the value of the datepicker?

Jakub Strebeyko staff answered 6 years ago


Hi there Miguel,

MDB Date Picker is a solution rooting out of a regular input element. As such, the Date Picker's value is accessible using .val() jQuery method. Consider the following snippet:

var datePicker = $('#date-picker-example');
datePicker.change(function(e){
console.log( datePicker.val() );
})

In case the value is necessary for, let's say, form submitting, its value gets POSTed just as any other. If that's the case though, please make sure that the Date Picker's input field has a name HTML attribute.

With Best Regards,
Kuba



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: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags