I am trying to increase date by giving the input variable, Can anybody please help me out from this problem.??
<html> <body> <h2>Select a Date in first TextBox. Then click the Button to see how 3 days is added to this Date and shown in "Follow Date" TextBox.</h2> <p>Date: <input id="txtDate" type="text" onchange="getdate()"/> <input id="inputDate" type="text" value="" onchange="getdate()"/> </p> <p>Follow Date: <input id="follow_Date" type="text"/> </p> <script> $(document).ready(function () { $('#txtDate').datepicker(); $('#follow_Date').datepicker(); }); function getdate() { var tt = document.getElementById('txtDate').value; var date = new Date(tt); var newdate = new Date(date); var ddd = document.getElementById('inputDate').value; newdate.setDate(newdate.getDate() + ddd); var dd = newdate.getDate(); var mm = newdate.getMonth() + 1; var y = newdate.getFullYear(); var someFormattedDate = mm + '/' + dd + '/' + y; document.getElementById('follow_Date').value = someFormattedDate; } </script> <body> </html>