Change output date according to a variable
<p>What I want is that output date should vary according to the input date and value selected of days to stay(d_stay),that is outputdate=inputdate(i_d)+value(d_stay),and it should change dynamically ,without refreshing the page.</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
   &lt;head&gt;
      &lt;link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"&gt;
      &lt;script src="http://code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"&gt;&lt;/script&gt;
      &lt;script&gt;
         $(function () {
             var dataSrc = ["australia", "austria", "antartica", "argentina", "algeria"];

             $("#myText").autocomplete({minLength:3,source:dataSrc });
         });
      &lt;/script&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;Make MY TRIP&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;?php
         If(isset($_REQUEST['submit']) != '') {
             If($_REQUEST['s_state'] == '' || $_REQUEST['s_date'] == '' || $_REQUEST['myText'] == '') {
                 Echo "please fill the empty field.";
             }

             Else {
                 $s = $_POST["myText"];
                 $i_d = $_POST["s_date"];

                 $date = DateTime::createFromFormat("Y-m-d", $i_d);
                 echo "Inputdate";
                 echo "&amp;nbsp";
                 echo $date - &gt; format("d F");
                 echo "&amp;nbsp";
                 echo "&amp;nbsp";
                 // echo "out date";


                 echo "

                 &lt; html &gt;
                     &lt; head &gt;
                     &lt; body &gt;
                     &lt; form method = 'Post' &gt;
                     &lt; select name = 'd_stay' &gt;
                     &lt; option value = '1' &gt; 1 &lt; /option&gt; &lt; option value = '2' &gt; 2 &lt; /option&gt; &lt; option value = '3' &gt; 3 &lt; /option&gt; &lt; option value = '4' &gt; 4 &lt; /option&gt; &lt; option value = '5' &gt; 5 &lt; /option&gt; &lt; option value = '6' &gt; 6 &lt; /option&gt; &lt; option value = '7' &gt; 7 &lt; /option&gt; &lt; /select&gt; &lt; /body&gt; &lt; /head&gt; &lt; /html&gt;
                 ";

             }
         }
         ?&gt;
      &lt;p&gt;
         Starting City
      &lt;form method="post" action="23.php"&gt;
         &lt;select name="s_state"&gt;
            &lt;option value="Shimla"&gt;Shimla&lt;/option&gt;
            &lt;option value="Delhi"&gt;Delhi&lt;/option&gt;
            &lt;option value="Chandigarh"&gt;Chandigarh&lt;/option&gt;
            &lt;option value="Pune"&gt;Pune&lt;/option&gt;
         &lt;/select&gt;
         Starting date
         &lt;input type="date" name="s_date" /&gt;
         &lt;p&gt;
            &lt;input id="myText" placeholder="Add city you wish to travel" name="myText"  role="textbox"/&gt;
         &lt;/p&gt;
         &lt;input type="submit" name="submit" value="submit" /&gt;
      &lt;/form&gt;
      &lt;/p&gt;
   &lt;/body&gt;
&lt;/html&gt;
</code></pre>