var mydate= new Date() var theyear=mydate.getFullYear() var themonth=mydate.getMonth()+1 var thetoday=mydate.getDate() todayvalue = themonth + '/' + thetoday+ '/' + theyear ; if (this.value=='') {this.value=todayvalue}