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
Code JavaScript:
<script language="javascript">
 
function calDate() {
	if(document.getElementById('status')='test'){
    var d = new Date(document.getElementById('year1').value);
 
    d.setDate(d.getDate()+7);
 document.getElementById("year2").value= d.getDate()+"-"+(d.getMonth()+1)+"-"+d.getFullYear();
	}
}
</script>