title: Displaying current day twice
body: <p>I have used javascript and html for the creation of my date dropdown. Onloading my php file it shows today's date. But the problem is , it shows today's day twice.
  For Eg: If today's date is 12-2-2015 It has options for DAY in dropdown as "1,2,3....11,12,12,14... and so on. Here 13th day is not shown. </p>
  
  <p>Can anyone please help me correct the dates.
  Here is my javascript:</p>
  
  <pre><code> var monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
  
  function populatedropdown(dayfield, monthfield, yearfield){
    var today=new Date()
    var dayfield=document.getElementById(dayfield)
    var monthfield=document.getElementById(monthfield)
    var yearfield=document.getElementById(yearfield)
    var thisday=1;
    for (var i=0; i&lt;31; i++) {
      dayfield.options[i]=new Option(thisday, thisday)
      thisday+=1;
    }
  
    dayfield.options[today.getDate()]=new Option(today.getDate(), today.getDate(), true, true) //select today's day
  
    for (var m=0; m&lt;12; m++) monthfield.options[m]=new Option(monthtext[m], monthtext[m])
  
    monthfield.options[today.getMonth()]=new Option(monthtext[today.getMonth()], monthtext[today.getMonth()], true, true) //select today's month
  
    var thisyear=1999
    for (var y=0; y&lt;45; y++){
      yearfield.options[y]=new Option(thisyear, thisyear)
      thisyear+=1
    }
    yearfield.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true) //select today's year
  }
  </code></pre>
  
  <p>This is my html code:</p>
  
  <pre><code>&lt;tr&gt;&lt;br&gt;&lt;td&gt;Date of Diagnosis&lt;/td&gt;&lt;td&gt;
    &lt;select id="daydropdown" name="daydropdown"&gt;&lt;/select&gt; 
    &lt;select id="monthdropdown" name="monthdropdown"&gt;&lt;/select&gt;
    &lt;select id="yeardropdown" name="yeardropdown"&gt;&lt;/select&gt;
    &lt;script type="text/javascript"&gt;
      //populatedropdown(id_of_day_select, id_of_month_select, id_of_year_select)
      window.onload=function() {
        populatedropdown("daydropdown", "monthdropdown", "yeardropdown")
      }
    &lt;/script&gt;&lt;/td&gt;
  &lt;/tr&gt; 
  </code></pre>