title: Carry the values of the form to the next's page form using JavaScript
body: <p>I have tried to save input values of a form on my index page and carry them to the booking page in cookies using JavaScript, but it didn't work. </p>
  
  <p>The form at index.html is:</p>
  
  <pre><code>  &lt;form id="check-book" name="check-book" method="post" action="/book.html" onsubmit="return storeValues(this);"&gt;
    &lt;fieldset&gt;
    &lt;label for="field_date_in"&gt;Дата заезда:&lt;/label&gt; 
     &lt;input type="text" id="field_date_in" size="8" readonly="readonly" name="sender_checkin"/&gt;
     &lt;label for="field_date_out"&gt;Дата выезда:&lt;/label&gt;
     &lt;input type="text" id="field_date_out" size="8" readonly="readonly" name="sender_checkout"/&gt;
     &lt;input type="submit" name="send_message" value="Забронировать!"&gt;
    &lt;/fieldset&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>which I need to carry to the booking page form:&nbsp;</p>
  
  <pre><code>&lt;form id="booking-form" name="contact-form" action="send-mail.php" method="POST"&gt;
    &lt;fieldset&gt;
    &lt;legend&gt;Контактная Информация&lt;/legend&gt;
     &lt;label for="field_name"&gt;Имя:&lt;/label&gt;
     &lt;input type="text" id="field_name" name="sender_name" placeholder="Введите Ваше Имя" autofocus/&gt;
     &lt;label for="field_email"&gt;E-mail:&lt;/label&gt; 
     &lt;input type="text" id="field_email"  pattern="[a-zA-Z]{3,}@[a-zA-Z]{3,}[.]{1}[a-zA-Z]{2,}" title="Пожалуйста введите e-mail" name="sender_email" placeholder="Введите Ваш e-mail"&gt;   
     &lt;label for="field_phone"&gt;Номер телефона:&lt;/label&gt; 
     &lt;input type="text" id="field_phone" name="sender_phone" placeholder="Введите Ваш Номер Телефона" &gt;
    &lt;/fieldset&gt;
    &lt;fieldset&gt;
     &lt;legend&gt;Информаци о бронировании&lt;/legend&gt;
     &lt;label for="room_selector"&gt;Выберите номер:&lt;/label&gt;&lt;select name="room_selector" id="room_selector"&gt;
     &lt;option value="eco_twin"&gt;Эконом (Две кровати)&lt;/option&gt;
     &lt;option value="std_twin"&gt;Стандарт (Две кровати)&lt;/option&gt;
     &lt;option value="std_double"&gt;Стандарт (Двойная кровать)&lt;/option&gt;
     &lt;option value="attic_twin"&gt;Эконом Мансарда (Две кровати)&lt;/option&gt;
         &lt;option value="attic_double"&gt;Эконом Мансарда (Двойная кровать)&lt;/option&gt;
     &lt;option value="lux_twin"&gt;Люкс (Две кровати)&lt;/option&gt;
     &lt;option value="lux_double"&gt;Люкс (Двойная кровать)&lt;/option&gt;
     &lt;option value="lux_wed"&gt;Люкс Свадебный&lt;/option&gt;
     &lt;option value="lux_lux"&gt;Суперлюкс&lt;/option&gt;
     &lt;/select&gt;
     &lt;label for="field_date_in"&gt;Дата заезда:&lt;/label&gt;
     &lt;input type="text" id="field_date_in" size="8" readonly="readonly" name="sender_checkin"/&gt;
     &lt;label for="field_date_out"&gt;Дата выезда:&lt;/label&gt;
     &lt;input type="text" id="field_date_out" size="8" readonly="readonly" name="sender_checkout"/&gt;
     &lt;label for="field_guests"&gt;Количество гостей:&lt;/label&gt;
     &lt;input type="number" step="1" value="1" min="1" max="100" id="field_guests" name="sender_guests" /&gt;
     &lt;label for="field_message"&gt;Сообщение:&lt;/label&gt;
     &lt;textarea id="field_message" name="sender_message" rows="5" cols="50"&gt;    &lt;/textarea&gt;&lt;br&gt;
    &lt;/fieldset&gt;
    &lt;fieldset&gt; 
     &lt;input type="submit" name="send_message" value="Отправить"&gt;
    &lt;/fieldset&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>and the JavaScript I tried was:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
    // Original JavaScript code by Chirp Internet: www.chirp.com.au
    // Please acknowledge use of this code by including this header.
  
    var today = new Date();
    var expiry = new Date(today.getTime() + 30 * 24 * 3600 * 1000); // plus 30 days
  
    function setCookie(name, value)
    {
      document.cookie=name + "=" + escape(value) + "; path=/; expires=" +         expiry.toGMTString();
    }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      function storeValues(form)  
      {
      setCookie("field_date_in", form.field_date_in.value);
      setCookie("field_date_out", form.field_date_out.value);
       return true;
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Now, how can I upload the values of index.html form to the book.html by using the stored cookies? (Assuming they are stored). I am very new to JavaScript and cookies for me are something that I either eat with coffee or clean when the browser is lagging.</p>