title: How to redirect to a url
body: <p>I would like to show client another page after data has been collected from previous page. But I have trouble redirect the new URL on the server side. Here is my logic:</p>
  
  <ol>
  <li>submit user input with POST action to server;</li>
  <li>server run function saveChoice() to save user input into a database;</li>
  <li>After user input is saved, server send a new URL to client;</li>
  <li>By the time the client GET the new URL, server reads the database and get saved data out</li>
  </ol>
  
  <p>And I am stuck on step 3 (here is an example of the flow):</p>
  
  <pre><code>type Stuff struct{
      List []string
  }
  
  func checkcheck(w http.ResponseWriter, r *http.Request) {
      sinfo := Stuff{
          List: some_slice
      }
  
      t, err := template.New("").Parse(tpl_ds)
      checkErr(err)
      err = r.ParseForm()
      checkErr(err)
      err = t.Execute(w, sinfo)
      checkErr(err)
  
      if r.Method == "POST" {
          saveChoice(r.Form["choices"])
          /* step 3: make user open another URL */
      }
  }
  </code></pre>
  
  <p>And here is the template:</p>
  
  <pre><code>&lt;html&gt;
  &lt;script&gt;
    $(function () {
      $('form').on('submit', function (e) {
        e.preventDefault();
        $.ajax({
          type: 'post',
          data: $('form').serialize(),
        });
      });
    });
  &lt;/script&gt;
  &lt;body&gt;
    &lt;form method="POST"&gt;
      {{range .List}}
          &lt;input type="checkbox" name="choices" value="{{.}}"&gt; &lt;span&gt;{{.}}&lt;/span&gt;&lt;br&gt;
      {{end}}
      &lt;input type="submit" value="Submit"&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>May I know how I can redirect to a new page?</p>
  
  <p>p.s. If I put URL on button, then server is not going to run saveChoice()</p>