I have text box 1 where user can enter date in mm/dd/yy or mm/dd/yyyy format. I would like to populate the text box 2 by adding 10 days to the date entered in the text box 1.
How do I add 10 days to the date in entered in mm/dd/yy or mm/dd/yyyy format.
Thanks.
<script type="text/javascript">
var d = new Date("04/10/2006");
d.setDate(d.getDate()+10);
alert((d.getMonth()+1)+"/"+d.getDate()+"/"+d.getYear());
</script>
... with Javascript it may be a good idea to use the full year.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.