> 
> i need to add a year to given date. I have try this code
> 
> 
> 

```
<script>
  function get_expir(){ 
     regDate = document.getElementById('txt1').value;         

     var da = new Date(regDate);
     da.setFullYear(da.getFullYear()+1, da.getMonth()+1);
     document.form1.txt2.value = da.getFullYear()+ '-'+ da.getMonth()+ '-'+ da.getDate();  
  }
</script

```

> 
> if the user input is '2012-02-29' then the output will comes '2013-2-29'.
>  Blockquote
> 
> 
>