Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to update the minDate value of jQuery DatePicker?
    primarykey
    data
    text
    <p>I have the following function to set the default value of minDate:</p> <pre><code>$(function() { $( "#arrival_date" ).datepicker(); $( "#arrival_date" ).datepicker('option','minDate','&lt;?php echo $minDate ?&gt;'); }); </code></pre> <p>But after the page load the $minDate variable sometimes change based on the earliest date in some of my function.</p> <p>Example if the value of $minDate is "7/29/2012" and after the page is fully loaded sometimes the $mindDate date changes to earlier than "7/29/2012". Say it will change to "7/20/2012".</p> <p>If this happens I want to change the minDate value of DatePicker to the new date (i.e. "7/20/2012" instead of "7/29/2012").</p> <p>How to call this function?</p> <p>UPDATE* Example code:</p> <pre><code>&lt;?php $checkin = "7/29/2012"; $minDate = $checkin; ?&gt; &lt;head&gt; $(function() { $( "#arrival_date" ).datepicker(); $( "#arrival_date" ).datepicker('option','minDate','&lt;?php echo $minDate ?&gt;'); }); &lt;/head&gt; &lt;body&gt; &lt;?php for($i=0;$i&lt;$max;$i++){ $r_id=$_SESSION['cart'][$i]['room_id']; if (!isset($room_id)){ $room_id=$r_id; }else{ $room_id=$room_id . "," . $r_id; } $checkin=$_SESSION['cart'][$i]['checkin']; $checkout=$_SESSION['cart'][$i]['checkout']; $nights=$_SESSION['cart'][$i]['nights']; $q=$_SESSION['cart'][$i]['qty']; $pname=get_room_type($r_id); if ($checkin &lt; $minDate) $minDate = $checkin; //&lt;--- here...how can I change the minDate of datepicker to the new value? } ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload