jquery/forms/date-picker/


Topic: jquery/forms/date-picker/

john.tazam asked 6 years ago

Dear support team,

I am trying to create a form to add or edit user details. If the user edits their details then I would like to populate all fields with existing data. On the date-picker, the placeholder works but how do I set the value? In the following code, you will see that I have used a value of "1990,10,3" but it doesn't work & I have tried many permutations before asking for your help:

<div class="md-form">
<input placeholder="<?php echo $dob; ?>" type="text" data-value="1990,10,3" id="date-picker-example" class="form-control datepicker">
<label for="date-picker-example"class="">Date of Birth</label>
</div>
 

 


Bartłomiej Malanowski staff pro premium answered 6 years ago

Hi, John!

You need to add the `formatSubmit` option to the "pickadate" so 

$('.datepicker').pickadate();

should be replaced with:

$('.datepicker').pickadate({
formatSubmit: 'yyyy,mm,dd',
});


You can see the demo on my snippet


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.15
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: Yes
  • Provided link: No
Tags