I am using the following function to generate three select boxes to select a date dd/mm/yyyy., with the current date selected:
<script type="text/javascript">
  var monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];
  function populatedropdown(dayfield, monthfield, yearfield){
    var today=new Date()
    var thisyear = today.getFullYear()
    var dayfield = document.getElementById(dayfield)
    var monthfield=document.getElementById(monthfield)
    var yearfield=document.getElementById(yearfield)
    for (var i=1; i<31; i++)
    dayfield.options[i]=new Option(i, i+1)
    dayfield.options[today.getDate()]=new Option(today.getDate(), today.getDate(), true, true) //select today's day

    for (var m=0; m<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

    for (var y=0; y<20; y++){
      yearfield.options[y]=new Option(thisyear, thisyear)
    yearfield.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true) //select today's year
This is working actually fine. The only thing i'm fighting with is that with using this method every month has 31 days. Is there a existing plugin that can handle this or should I adjust this function? And if so where is the best place to look or find a tutorial about this subject!

Thank you in advance