 <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $("#date, #date2,#date3,#date4").datepicker(); $("#date,#date2,#date3,#date4 ").datepicker("option", "dateFormat", "yy/mm/dd"); var d = new Date(); var todaysM = d.getDate() + "/" + (d.getMonth() + 1) + "/" + d.getFullYear(); var todaysM = d.getFullYear()+ "/" + (d.getMonth() + 1) + "/" + d.getDate(); if ($("#date,#date2,#date3").val() == "") { $("#date,#date2,#date3").val(todaysM); } }); &lt;/script&gt; </code></pre>