title: Get form values to create a custom URL
body: <p>I have the following form:</p>
  
  <pre><code>&lt;form&gt;
          &lt;div&gt;Adults&lt;/div&gt;
          &lt;div&gt;
              &lt;select name="adults"&gt;
              &lt;option selected="selected" 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;/select&gt;
          &lt;/div&gt;
      &lt;/div&gt;      
      &lt;div&gt;
          &lt;div&gt;Children&lt;/div&gt;
          &lt;div&gt;
              &lt;select name="children"&gt;
              &lt;option selected="selected" value="0"&gt;0&lt;/option&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;/select&gt;
          &lt;/div&gt;
      &lt;/div&gt;      
      &lt;div&gt;
          &lt;div&gt;Check-in date&lt;/div&gt;
          &lt;div&gt;
              &lt;input name="date_from" value="16-04-2015" type="text"&gt;&lt;/div&gt;
      &lt;/div&gt;      
      &lt;div&gt;
          &lt;div&gt;Check-out date&lt;/div&gt;
          &lt;div&gt;&lt;input name="date_to" value="17-04-2015" type="text"&gt;&lt;/div&gt;
      &lt;/div&gt;      
      &lt;div&gt;
          &lt;input value="Check Availability" type="submit"&gt;
      &lt;/div&gt;      
  &lt;/form&gt;
  </code></pre>
  
  <p>Now I want to call a javascript function on above form submit. This function will get all form elements values and create the following URL to redirect.</p>
  
  <pre><code>online-reservation.html#!/Rooms/date_from:16-04-2015/date_to:17-04-2015/adults:1/children:0
  </code></pre>
  
  <p>How can I create this JS function?</p>
  
  <p>Thanks.</p>