datepicker - How to set minDate of jQuery Calendar Picker? -


i have 2 date pickers, follows:

first date picker: txtdate

html:

date :   <input type="text" id="txtdate"/> 

jquery:

$(function() {     $("#txtdate").datepicker({         changemonth : true,         changeyear : true,         dateformat: "yymmdd"     }) }); 

second date picker: dateavailable

html:

date available :    <input type="text" id="dateavailable" />  

jquery:

var dateavailable = new date(document.getelementbyid('txtdate').value);  $(function(){     $("#dateavailable").datepicker({         changemonth : true,         changeyear : true,         dateformat: "yymmdd",         mindate: new date(dateavailable)     })               }); 

the second datepicker: dateavailable should not less than first datepicker: txtdate. need date picked @ txtdate set mindate of dateavailable,

but code not working me..how set mindate of dateavailable?

here go, jsfiddle demo,

you needed dynamically change value of other datepicker, doing did setting minimum value of second datepicker @ time of loading page @ first time.

but when changed first datepicker, did not change min value of second. need use onclose, , change min value.

$(function() {     $("#txtdate").datepicker({      changemonth : true,      changeyear : true,      dateformat: "yymmdd",         onclose: function(){             $( "#datepicker" ).datepicker('change',{                  mindate: new date($("#txtdate").datepicker('getdate'))             });         }     })      $( "#datepicker" ).datepicker({          yearrange: '1999:c+1' ,         changeyear: true,         mindate: new date(1999, 10 - 1, 25),         maxdate: '+30y',     }); }); 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -