Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: jquery/forms/date-picker/

john.tazam free 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>
 

 



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

  • ForumUser: 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