title: setting multiple cookies on page load
body: <p>I am new to programming and I struggle a lot with cookies in JavaScript, so I have used this tutorial <a href="https://www.youtube.com/watch?v=sACXO0n9Lgw" rel="nofollow">here</a>. I used the 'create cookie function' but I am unsure about how to make a function that puts the cookies back into the text boxes on page load. I have looked at W3 Schools and still have no idea. Any ideas?</p>
  
  <p>Here is the create cookie function I used which creates cookies from 'more than one' textbox.</p>
  
  <pre><code>function createCookie(nCookie){
  var expDate = new Date();
  expDate.setMonth(expDate.getMonth() + 12);
  var cookieVal = document.getElementById(nCookie).value;
  document.cookie = nCookie + "=" + cookieVal + ";path=/;expires=" +
  expDate.toGMTString();}
  </code></pre>