Sunday, August 21, 2016

Set custom date in datepicker using jquery


Hi falks,

 I just tried to set custom or dynamic  date in j query date picker but after lot of failure, I just invented the method by which anybody can do it in very easy method. After the tutorial you can do anything which you want to do with your date picker calendar.


Just use:
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#datepicker" ).datepicker();
    $( "#datepicker" ).datepicker("setDate", "20-02-2017");
  } );
  </script>
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>


</body>
</html>


solution:

if you got any hurdle in j query to display date picker then use double date-picker . one is for init and anther is for set custom setting to you calendar.

hope you understand but if you have any doubt regarding this please write comment or mail me.

No comments:

Post a Comment

Dharamart.blogspot.in