On my form, I'm trying to calculate the due_date based on the test_date.
The following code only gives me today's date, but works for that, I need to adapt it for a given number of days. For example, 7 days. So if the test_date was 9/29/2015, I'd get 10/06/2015 for the due_date.
Code: Select all
<input type="date" id="dddd" class="form-control" name="due_date" readonly>
<script>
document.getElementById('dddd').value = new Date().toISOString().substring(0, 10);
</script>