help please,
my code working, , activating day of week want, default textbox has no value, want value of textbox equal first date activated in datepicker
my code is:
<script> var j = 3; $(function() { $('#datepicker').datepicker({ mindate: 0, beforeshowday: function(date) { var weekday = parseint(j, 10); if (weekday === date.getday()) { return [true, '', '']; } return [false, '', '']; } }); // getter var mindate = $( '#datepicker' ).datepicker( "option", "mindate" ); $( '#datepicker' ).datepicker( "option", "dateformat", "yy-mm-dd" ); }); </script>
<input type=text name='dtpick' id='datepicker'>
if got question want:
$(function() { $('#datepicker').datepicker({ mindate: 0, beforeshowday: function(date) { var weekday = parseint(j, 10); if (weekday === date.getday()) { return [true, '', '']; } return [false, '', '']; } }); }); $(document).ready(function($) { var mindate = $('#datepicker').datepicker("option", "mindate"); $( "#datepicker" ).datepicker( "setdate", mindate); });
you have pass mindate variable setdate method.
Comments
Post a Comment