Add year to the date

I used this code to add days to date but there’s problem
year1 is the text field and status is dropdown menu
i want to add date the first textfield and when change dropdown change year2

<script language="javascript">

function calDate() {
    var d = new Date(document.getElementById('year1').value);

 document.getElementById("year2").value= d.getDate()+"-"+(d.getMonth()+1)+"-"+d.getFullYear();